In a data driven custom actions that modify machine state (which it sounds like you are writing) an immediate custom action should read tables and/or Properties in the MSI to schedule the appropriate deferred custom actions to make changes to the machine.
To accomplish this, all of the custom actions are defined (CustomAction
elements in your .wxs files) but only the immediate custom actions are scheduled (Custom/@Action
elements in the InstallExecuteSequence
). The immediate custom actions look about, make decisions, set the CustomActionData
for the deferred custom action, then call ::MsiDoAction()
with the name of the appropriate deferred custom action to add the deferred custom action to the installation script at that point. Later, when the Windows Installer executes the installation script (the deferred part of the install), the deferred custom actions will kick off with all their data.
The WiX toolset custom actions do this all the time if you are looking for examples.