Sequencing a Custom Action that Calls a Script

InstallShield 2015

Project: The VBScript and JScript information applies to the following project types:

Basic MSI
DIM
InstallScript MSI
Merge Module
MSI Database
MSM Database
Transform

The InstallScript information applies to the following project types:

Basic MSI
InstallScript MSI
Merge Module

Using script inside your custom action enables you to perform virtually any task. For example, you can launch external applications or create registry entries.

VBScript and JScript Code

Installed with the Product

If your script file is going to be installed as part of the installation, you should follow one of two sets of rules depending on which scheduling property (Deferred Execution or Immediate Execution) you chose. For Immediate Execution, you must insert your action after the InstallFinalize action in order for it to work properly. For Deferred Execution, you need to insert the action after the InstallFiles action and before the InstallFinalize action.

Settings for Actions that Call a VBScript or JScript File that Is Installed with the Product

Action Type

Location

Scheduling

Sequence

Run VBScript or JScript Code

Installed

Immediate Execution

After InstallFinalize

Run VBScript or JScript Code

Installed

Deferred Execution

After InstallFiles and before InstallFinalize

Stored in the Binary Table

If the script file that you are calling is stored in the Binary table, you can place the action anywhere in the sequence.

Settings for Actions that Call a VBScript or JScript File that Is Stored in the Binary Table

Action Type

Location

Scheduling

Sequence

Run VBScript/JScript Code

Temporary

Not applicable

Anywhere in the sequence

Already Present on the Target System

If the script file that you want to call is already present on the system, you need to insert your action after the CostFinalize action is called.

 

Action Type

Location

Scheduling

Sequence

Run VBScript/JScript Code

Local

Not applicable

After CostFinalize

Stored Directly in the Custom Action

If you chose to place your script directly in the custom action, you can place the action anywhere in the sequence.

InstallScript Code

InstallScript custom actions differ from JScript or VBScript custom actions because the source files for InstallScript actions are always streamed into the .msi package. Therefore, the custom action can be inserted into a sequence anywhere after the action that has 2 as its sequence number. This limitation occurs because the script engine launches during sequence number 2. Therefore, if you call your script before the script engine launches, the system is not able to process it.

If your custom action contains feature functions or setup type dialog functions, you must insert the custom action after the CostInitialize, FileCost, and CostFinalize actions.