You can add Custom Actions to the installation process in the Custom Actions page.

In the left-side pane there is a tree with a number of branches representing the stages of installation. There are two main branches which correspond to the two main installation phases and a secondary branch which represents the custom actions which can be used by DoAction control events on the installation dialogs:

  • InstallUISequence - Contains the actions that are executed when displaying the user interface (if the user interface is set to full). The actions in this sequence are executed only if you have not selected the basic type of interface (in the Install Parameters page).
  • InstallExecuteSequence - Corresponds to the sequence that follows the [ Install ] button's pressing.
  • UI Custom Actions - These custom actions are used by the Dialog Editor and are executed by control events.

For each of these you can show more branches in which you can add custom actions, using the [ Show Standard Action ] toolbar button. These branches represent the standard actions which are executed during an installation.

NoteWhen adding a custom action under a standard action, the custom action is executed after the standard action runs.

The custom actions from a branch will be executed in the order they appear in the tree. You can drag and drop a custom action to change the order in a branch or even move it from a branch to another.

You can also share a custom action between two standard actions, provided one it is located in the InstallUISequence and the other in the InstallExecuteSequence. Simply drag a custom action from one sequence to the other, while pressing the Shift key.

In the right-side pane you can see all the Custom Action Properties for the one selected in the tree.

Creating a new custom action using a wizard

New Custom Action WizardUse the [ New Custom Action Wizard ] toolbar button, to quickly and easily create a new custom action, following step-by-step directions.

Adding a custom action to be run from a file attached to the installation

New Attached Custom Action Use the [ New Attached Custom Action ] toolbar button or tree context menu item or press the Insert key while the “Install Sequence” panel is focused. An "Open File" dialog will appear and you can choose the custom action file from your disk.

Caution!It is not recommended to use a "MSI database attached to installation" custom action because is deprecated. Also, this type of custom action cannot be uninstalled from the "Add or Remove Programs" applet.

Adding a custom action to be run from a file installed with the installation

New Installed Custom Action Use the [ New Installed Custom Action ] toolbar button or tree context menu item or press the + key while the “Install Sequence” panel is focused. An File Picker Dialog dialog will appear and it will allow you to select a file only from your project.

Adding a Windows Installer custom action

New Custom ActionTo create a new Windows Installer custom action select an installation sequence by clicking on it, then use the [ New Custom Action ] toolbar button or tree context menu item.

Showing a standard action

Show Standard ActionTo show a standard action select an installation sequence by clicking on it, then use the [ Show Standard Action ] toolbar button or tree context menu item.

This option presents more Standard Actions after which you can schedule custom actions. The standard action available depends on the sequence you have clicked (for example InstallUISequence has only few standard actions. In the case of InstallExecuteSequence, those actions are divided into three groups: “Before Initialization >”, “Before File Installation >” and “Before Finalization >”. After adding such actions to the “Install Sequence”, you can schedule custom actions in the sequence range starting with them. To do that, select a folder in the left side tree and then create a new Custom Action or drag&drop an existing custom action from another folder.

NoteSome standard action have identical names for both sequences but they represent distinct stages in the install sequence.

Removing a custom action

Remove Use the [ Delete ] toolbar button, the “Delete” tree context menu item or press the Delete key while the “Install Sequence” panel is focused.

Renaming a custom action

You can rename a custom action by selecting the “Rename” tree context menu option or by pressing the F2 key, while an element from that branch is selected.

Move After

The “Move After >” context submenu presents the available Standard Actions after which you can move the selected Standard Action. The custom actions that were scheduled after (below) the moved standard action will not move. Instead, they will become scheduled after the standard action that was situated before (above) the previously moved standard action. The moved standard action will appear between the standard action that was selected from the "Move After >" context submenu and the custom actions scheduled after (below) this standard action.

Caution! Moving a standard action into a wrong place can broke your installation.

NoteThe Move After > operation is available only in MSI projects.

Custom Action Return Code

The return code of a custom action depends on the type of the source file. Therefor, the return code of a function called from a VBScript is not the same with the one returned by an .exe or dll file.

For more information regarding custom action return codes please see: Custom Action Return Values.

For more information regarding JScript or VBScript return codes please see: Return Values of JScript and VBScript Custom Actions.

Topics