Inserting Actions into Sequences

Project:This information applies to the following project types:

Basic MSI
InstallScript MSI
MSI Database
Transform

Sequences dictate when all of the actions that are associated with an installation will be executed. You can add, remove, or reorder actions in any sequence. For example, if you want to display a readme file as part of the installation, you can add to your installation a custom action that launches the readme file. This action must be inserted into a sequence.

Inserting actions into a sequence is governed by when actions in that sequence launch. Many actions rely on other actions executing before they can function. For example, if you want to launch an executable file that will be installed as part of your installation, you cannot execute the action that relies upon that executable file until the point in the sequence when the files have been installed.

Note:InstallShield does not provide any validation on your sequences. If an action is placed in a sequence where it cannot function properly, an error will not occur until the installation is run.

Inserting an Action

To insert an action into a sequence:

1. In the View List under Behavior and Logic, click Custom Actions and Sequences.
2. In the Sequences explorer, right-click the action or dialog that you want your action to follow and click Insert. The Insert Action dialog box opens, providing a list of all the actions and dialogs that can be added to the sequence.
3. In the list at the top of the dialog box, select the type of action that you want to insert.
4. In the box that shows a list of actions, select the action that you want to insert.
5. Click OK.

InstallShield also includes drag-and-drop support that enables you to drag and drop custom actions from the Custom Actions explorer to a sequence in the Sequences explorer.

To insert a custom action into a sequence using the drag-and-drop method:

1. In the View List under Behavior and Logic, click Custom Actions and Sequences.
2. Drag the custom action from the Custom Actions explorer to the appropriate location in a sequence under the Sequences explorer. When you drop it, drop it onto the item that should be directly before it in the sequence.

Note:A custom action cannot be called twice in the same sequence, since the custom action name is the key in the CustomAction table. Therefore, you cannot insert a custom action to a sequence that already contains that custom action.

Determining Where to Insert the Action

There are several categories of custom actions that you can include in your installation: calling a standard or Windows Installer–ready DLL function, launching an executable file, running a script (JScript, VBScript, or InstallScript), setting a property or directory, and launching a second .msi installation. All types can be called at different times depending on the configuration of the custom action. For more information, see the following:

Sequencing a Custom Action that Calls a Function in a DLL File
Sequencing a Custom Action that Launches an .exe File
Sequencing a Custom Action that Calls a Script
Sequencing Custom Actions that Set Properties or Directory Properties
Sequencing a Custom Action that Launches a Second .msi Package

Considerations for Custom Actions from Included Merge Modules

You can control the launch of custom actions in a merge module by modifying the ModuleInstallExecuteSequence table in the Direct Editor. When you add the merge module to your installation project, all custom actions and dialogs included in the merge module are available for you to insert in the installation’s sequences through the Custom Actions and Sequences view.