Action Type Panel

InstallShield 2015 » Custom Action Wizard

Project: The Custom Action Wizard is available in the following project types:

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

The Action Type panel lets you specify the type of custom action that you want to create and where the code for that action is stored.

Panel Options

Type

The Type list provides options for several different ways of executing your custom action. For example, your custom action can call an executable file, run VBScript code, or call a function from a .dll file. The following options are available in this list:

Available Types of Custom Actions

Type

Project Type

Description

Call a function in a standard dynamic-link library

Basic MSI,
InstallScript MSI

This custom action calls a function in a .dll file. Specify the function name, parameters, and return value in the Function Definition panel.

Note: If you call a function in a standard .dll file that is stored in the Binary table, you cannot use deferred or rollback execution for the action’s In-Script Execution setting.

If you call a function in a standard .dll file that is installed with the product and the action is scheduled as deferred (for the In-Script Execution setting), the .dll file that you are calling must be the component’s key file.

Call a function in a Windows Installer dynamic-link library

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

This custom action calls a function from a .dll file written specifically for Windows Installer. The .dll file’s entry point must have a predefined parameter and return value.

Call a public method in a managed assembly

Basic MSI,
DIM,
InstallScript MSI,
Merge Module

This custom action calls 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.

Display error message and abort

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

This custom action displays a specified error message, returns failure, and ends the installation.

Launch an executable

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

This custom action launches an executable file.

Launch another .msi package

Basic MSI,
InstallScript MSI,
MSI Database,
Transform

Also known as a nested installation, this type of custom action launches a second .msi package during your 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.

Run 64-bit JScript code

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

This custom action runs 64-bit JScript code instead of a compiled language such as C or Visual Basic.

Run PowerShell code

Basic MSI,
InstallScript MSI

This custom action runs a PowerShell script (.ps1).

For target system requirements, as well as other information about this type of custom action, see Calling a PowerShell Custom Action.

Run 64-bit VBScript code

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

This custom action runs 64-bit VBScript code instead of a compiled language such as C or Visual Basic.

Run InstallScript code

Basic MSI,
InstallScript MSI,
Merge Module

This custom action calls a function from your InstallScript code.

Run JScript code

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

This custom action runs JScript code instead of a compiled language such as C or Visual Basic.

Run VBScript code

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

This custom action runs VBScript code instead of a compiled language such as C or Visual Basic.

Set a property

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

This custom action sets 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 a directory

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

This custom action sets 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.

Terminate a process by identifier

Basic MSI,
InstallScript MSI

This custom action kills a process that has a specific process identifier (PID).

Important: When you create this type of custom action, you also need to define a property that identifies the PID that you want to stop. To learn more see Calling a Kill-Process Custom Action.

Terminate a process by name

Basic MSI,
InstallScript MSI

This custom action kills a process that has a specific executable file name.

Important: When you create this type of custom action, you also need to define a property that identifies the name of the process that you want to stop. To learn more see Calling a Kill-Process Custom Action.

Location

The code that your custom action calls can be stored in one of several places. Select the location where the installer should look for that code. Note that some custom action types do not support some of the locations. In addition, the Location setting is not applicable for the error custom action.

Possible Locations for Storing Custom Actions

Location

Custom Action Type

Description

An application that is advertised or already installed

Launch another .msi package

Select this location to uninstall any Windows Installer applications that are currently installed on the target system—for example, applications that you previously installed with a custom action. You should have this custom action launch only on uninstallation of your main installation.

Destination machine search path

Standard DLL

When you call a function in a standard .dll file, the file can be present in the target system’s search path.

Included within your main setup

Launch another .msi package

Select this location if the .msi file that you want to launch is stored within your main installation package.

Installed with the product

Standard DLL,
MSI DLL,
Managed code,
Executable file,
PowerShell code,
VBScript,
64-bit VBScript,
JScript,
64-bit JScript

Select this location to call code from a file or executable file that is going to be installed on the target system.

Stored directly in the custom action

VBScript,
64-bit VBScript,
JScript,
64-bit JScript

Select this location to enter code directly into the wizard, without having to associate a file.

Stored in the Binary table

Standard DLL,
MSI DLL,
Managed code,
Executable file,
PowerShell code,
VBScript,
64-bit VBScript,
JScript,
64-bit JScript

Select this location to have your code base stored in the Binary table. This option is useful if you do not want the file to be installed on the target system.

Note: For the managed-code type of custom action, InstallShield creates a C++ Windows Installer wrapper DLL for your .NET assembly at build time. The wrapper DLL includes your assembly, as well as the information that is required to mediate, load, and run the assembly. InstallShield stores the wrapper DLL in the Binary table.

Stored in the Directory table

Executable file

Select this location to reference a path—without the file name—that is stored in the Directory table.

Stored in the Property table

Managed code,
Executable file,
VBScript,
64-bit VBScript,
JScript,
64-bit JScript

Select this location to reference a full path to the executable that you want to launch. The path is stored in the Property table.

Stored on the source media

Launch another .msi package

Select this location if the .msi file that you want to launch is stored on the same media as your main installation package.

See Also