Specifying the Order of Self Registration

Windows Installer

Specifying the Order of Self Registration

Note that you cannot specify the order in which the installer registers or unregisters self-registering DLLs by using the SelfRegModules and SelfUnRegModules actions. These actions register all the modules listed in the SelfReg table. The installer does not self-register .exe files.

To specify the order in which the installer registers or unregisters modules, you must use two custom actions for each module. One custom action for DllRegisterServer and a second for DllUnregisterServer. These custom actions must then be authored in the InstallExecuteSequence table at the point in the sequence wherever the DLL is to be registered or unregistered.

The following example illustrates how to author the database to schedule the self-registration of a DLL at a particular point in the action sequence.

File Table (partial)

File Component_ FileName Sequence
mydll myComponent Mydll.dll 13

 

Component Table (partial)

Component ComponentId Directory_ KeyPath
myComponent {a GUID} myFolder mydll

 


Directory Table

Directory Directory_Parent DefaultDir
TARGETDIR SourceDir
myFolder TARGETDIR myFolder|My Folder

 


CustomAction Table

Action Type Source Target
mydllREG 3170 myFolder "[SystemFolder]msiexec" /y "[#mydll]"
mydllUNREG 3170 myFolder "[SystemFolder]msiexec" /z "[#mydll]"

 


InstallExecuteSequence Table (partial)

Action Condition Sequence
SelfUnregModules 2200
mydllUNREG $myComponent=2 2201
RemoveFiles 3500
InstallFiles 4000
SelfRegModules 6500
mydllREG $myComponent>2 6501

 



Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.