Sequencing a Custom Action that Calls a Function in a DLL File

InstallShield 2015

If you want to sequence a custom action that calls a function in a DLL file, there are three different ways to reference the DLL file, depending on where the DLL file is located during the installation:

The DLL file can be streamed into the .msi file, but it is not installed.
The DLL file can be in the target system’s path (applies to a standard DLL file but not a Windows Installer DLL file).
The DLL file can be installed with the rest of the installation files.

Other considerations include scheduling. The two main scheduling choices are Immediate Execution and Deferred Execution. Immediate Execution means that Windows Installer will execute your custom action as it processes the .msi file. Deferred Execution tells the installer to queue the action and perform it in sequence in the script.

DLL Files Stored in the .msi Package

When you are calling a function from a DLL file that is stored in the .msi package, you can place the custom action anywhere in the sequence.

Settings for Actions that Call a Function in a DLL File that is stored in the .msi Package

Action Type

Location

Scheduling

Sequence

DLL Function

Stored in .msi package

Not applicable

Anywhere

DLL Files Found in the System’s Path

When you are calling a function from a DLL file that exists on the target system, there are also no restrictions on where you can place the custom action in the sequence.

Settings for Actions that Call a Function in a DLL File that Is Found in the System’s Path

Action Type

Location

Scheduling

Sequence

DLL Function

On target system

Not applicable

Anywhere

Installed DLL Files

If you are calling a DLL function from a file that is going to be installed to the target machine during the installation and you have it scheduled to run during Immediate Execution, you can place the action only after the InstallFinalize action. If you want the action to occur during Deferred Execution, place the action after the InstallFiles action and before the InstallFinalize action. The following table illustrates this point:

Settings for Actions that Call a Function in a DLL File that Is Already Installed

Action Type

Location

Scheduling

Sequence

DLL Function

Installed

Immediate Execution

After InstallFinalize

DLL Function

Installed

Deferred Execution

Before InstallFinalize and After InstallFiles