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 | Directory_Parent | DefaultDir |
|---|---|---|
| TARGETDIR | SourceDir | |
| myFolder | TARGETDIR | myFolder|My Folder |
| 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 |
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
