Question

I'd find it really useful to decide what custom actions I call at certain points in my installation depending on properties I've set in the installer.

For example; if I want to use separate DLLs for interfacing with different versions of SQL (SSRS 2005/2008R2 to be specific).

Assume the actions that discern which CA I should run (by finding out what SSRS version the installer is being pointed at) are executed with "immediate" and the CA's that may or may not be executed depend on this result and are "deferred"

How could I change which deferred CA I execute at certain parts of the install, dynamically, during the install?.. Is this even possible?

((WiX 2.0 preferred but higher version answers are acceptable))

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top