Custom Action Types

InstallShield 2012 Spring

Project: This information applies to the following project types:

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

Note that some custom action types are not available in some project types. Project-specific differences are noted where appropriate.

InstallShield includes support for several kinds of custom actions:

Custom Actions Supported in InstallShield

Icon

Action Type

Project Type

Custom Action Behavior

InstallScript

Basic MSI, InstallScript MSI, Merge Module

Run InstallScript code.

EXE

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

Launch an executable file.

Standard DLL

Basic MSI, InstallScript MSI

Call a function in a standard DLL.

MSI DLL

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

Call a function in a DLL that was written specifically for Windows Installer.

The entry point of the .dll file must have a predefined parameter and return value.

Managed Code

Basic MSI, DIM, InstallScript MSI, Merge Module

Call a public method in a managed assembly that is written in managed code such as Visual Basic .NET or C#.

For more information, see Calling a Public Method in a Managed Assembly.

Set Property

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

Set a property in the Property table.

This is useful if you need to get information from the end user and store it so that it can be used later in your installation.

Set Directory

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

Set a directory in the Directory table at run time.

For example, if you want to create a temp directory that is a subdirectory of the installation directory selected by the end user, you can use this option to set that new temp directory for use later in the installation.

Nested MSI

Basic MSI, InstallScript MSI, MSI Database, Transform

Launch another .msi package. This is also known as a nested installation.

Important: Nested installations is a deprecated feature of the Windows Installer. Applications installed with nested installations sometimes fail because they are difficult for end users to service correctly. Microsoft Corporation recommends that you avoid using nested installations and nested-installation custom actions to install products that are intended to be released to the public. To learn more, see Concurrent Installations in the Windows Installer Help Library.

VBScript

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

Run 32-bit or 64-bit VBScript code.

JScript

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

Run 32-bit or 64-bit JScript code.

Error

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

Display a specified error message, return failure, and end the installation.

For example, you may want to add an error custom action to your project to handle scenarios where an end user tries to install the current version of your product over a future major version. For more information, see Preventing the Current Installation from Overwriting a Future Major Version of the Same Product.

Kill Process

Basic MSI, InstallScript MSI

Terminate a process at run time. For more information, see Calling a Kill-Process Custom Action.

PowerShell

Basic MSI, InstallScript MSI

Run a PowerShell script to perform system configuration tasks at installation run time. For target system requirements, as well as other information about this type of custom action, see Calling a PowerShell Custom Action.

To help you differentiate between immediate, deferred, commit, and rollback custom actions in your project, InstallShield adds color-coded dots to some of the action's icons. The dots are displayed on the icons for actions that are listed under the Custom Actions explorer in the Custom Actions and Sequences view or the Custom Actions view. The following table shows the icon for the executable file custom action.

Determining the In-Script Execution of a Custom Action by Viewing Its Icon

Icon

Description

If a custom action does not have a dot, it indicates that the In-Script Execution setting is not applicable to that type of custom action, or one of the following values is selected:

Immediate Execution
Immediate Execution (Terminal Service Aware)

If a custom action has a blue dot, one of the following values is selected for the action's In-Script Execution setting:

Deferred Execution
Deferred Execution (Terminal Service Aware)
Deferred Execution in System Context

If a custom action has a green dot, one of the following values is selected for the action's In-Script Execution setting:

Commit Execution
Commit Execution (Terminal Service Aware)
Commit Execution in System Context

If a custom action has a red dot, one of the following values is selected for the action's In-Script Execution setting:

Rollback Execution
Rollback Execution (Terminal Service Aware)
Rollback Execution in System Context

For details about each of the InstallShield custom actions that are added automatically to InstallShield projects to support different functionality, see InstallShield Custom Action Reference.

See Also