Custom Action Settings

InstallShield 2015

Project: Use the Custom Actions and Sequences view to configure custom action settings in the following project types:

Basic MSI
InstallScript MSI
MSI Database
Transform

Use the Custom Actions view to configure custom action settings in the following project types:

DIM
Merge Module
MSM Database

Note that some custom action types are not available in some project types.

The settings in the Custom Actions and Sequences view (or Custom Actions view) are organized into the following categories:

Action area settings
Sequence area settings

To learn about displaying action information on the progress dialog and in the installation’s log file, see Using Action Text.

Action Area Settings

The following custom action settings are available in the Action area.

Custom Action Settings in the Action Area

Setting

Description

Function Name

Note: This setting applies to InstallScript custom actions.

In the list of functions that are included in the project's InstallScript files, select the InstallScript function that you want to call.

DLL File Name

Note: This setting applies to standard DLL custom actions that are stored in the Binary table or located in the target system’s search path. This setting also applies to MSI DLL custom actions that are stored in the Binary table.

For the Binary table location: Enter the path to the DLL file that you would like to use for your custom action. As an alternative, you can select it from the list of available DLL files in the Binary table, or click the ellipsis button (...) to browse to it.

For the target system’s search path location: Enter the name of the DLL file that you would like to use for your custom action. As an alternative, you can click the ellipsis button (...) to browse to it. Only the file name is needed, since the custom action searches in the target system's search path to find this DLL.

If the custom action type is an MSI DLL, the DLL file must comply with the required Windows Installer function signature. To learn more, see Calling Functions in Windows Installer DLL Files.

DLL Filekey

Note: This setting applies to standard and MSI DLL custom actions that are installed with the product.

In the list of DLL files that are included in your project, select the DLL file that you would like to use for your custom action.

Function Signature

Note: This setting applies to standard DLL custom actions.

To specify the parameters for the entry-point function in your DLL file, click the ellipsis button (...) in this setting. This opens the Function Signature dialog box, which has various settings that let you specify the function name, arguments, return type, and return property for the entry point function in your standard DLL.

Function Name

Note: This setting applies to MSI DLL custom actions.

Enter the name of the function in the MSI DLL that you would like to call.

Executable File Name

Note: This setting applies to executable file custom actions that are stored in the Binary table.

Enter the path to the executable file that you would like to use for your custom action. As an alternative, you can select it from the list of available executable files in the Binary table, or click the ellipsis button (...) to browse to it.

Executable Filekey

Note: This setting applies to executable file custom actions that are installed with the product.

In the list of executable files that are included in your project, select the executable file that you would like to use for your custom action.

Working Directory

Note: This setting applies to executable file custom actions that are located in a path that references a directory.

Enter the working directory name for the executable file that you would like to use for your custom action, or select it from the list of available directories.

File Name & Command Line

Note: This setting applies to executable file custom actions that are located in a path that references a directory.

Enter path and name of the executable file that you would like to use for your custom action. If appropriate, you can include any command-line parameters that should be passed to the executable file. Use quotation marks around long file names. For example:

"[INSTALLDIR]subdirectory1\filename.exe"
"[WindowsFolder]Notepad.exe"
"[SUPPORTDIR]\fileFromSupportFilesView.exe"

Note that the path is optional only if the executable file is already present in the operating system search path (that is, WindowsFolder or SystemFolder).

Executable Property

Note: This setting applies to executable file custom actions that are located in a path that is identified by a property.

Enter the name of the property that identifies the full path to your executable file, or select the property from the list of properties in your project.

Command Line

Note: This setting applies to executable file custom actions that are stored in the Binary table, installed with the product, or located in a path that is identified by a property.

Enter any command-line parameters that you would like to pass to your executable file. Enclose long file names within quotation marks.

Assembly File

Note: This setting applies to custom actions that use a managed assembly whose location is set to Binary table.

Specify the .NET assembly file that you want to use for your managed-code custom action. You can select the Browse to file option to specify the file, or select the file from the list of DLL and .exe files that will be stored in the Binary file.

At build time, InstallShield adds the managed assembly to a C++ Windows Installer wrapper DLL and adds the wrapper DLL to the Binary table of your .msi package. The wrapper DLL contains the information that is required to mediate, load, and run your assembly.

Assembly Filekey

Note: This setting applies to custom actions that use a managed assembly installed with the product.

To specify the managed assembly that you want to use for your custom action, select the file from the list of DLLs and .exe files that are included in your project.

Assembly Property

Note: This setting applies to custom actions that use a managed assembly whose path references a property or a directory in the Directory table.

To specify the managed assembly that you want to use for your custom action, do one of the following:

Select a Windows Installer property in the list.
Type the name of a new property.
Type the name of a directory in the Directory table.

The property or directory name must be enclosed within square brackets ([]). You can add a string after the property if appropriate. The resulting path should indicate the location of the assembly file.

Method Signature

Note: This setting applies to custom actions that use a managed assembly.

Click the ellipsis button (...) to launch the Method Signature dialog box, which is where you specify arguments and return values for the managed method. When you have specified signature information on this dialog box, InstallShield uses it as the value of the Method Signature setting.

To learn more, see Specifying the Signature for a Managed Method in an Assembly Custom Action.

Error Message

Note: This setting applies to custom actions that trigger an error message.

Type the error message text that should be displayed when the custom action’s conditions are met on the target system.

As an alternative, you can type a property name whose value contains the error text. The property name must be enclosed within square brackets ([]).

Function Name

Note: This setting applies to kill-process custom actions.

Select the appropriate function:

KillProcess—If you selected one of the immediate options in the In-Script Execution setting and you want to kill a process that has a particular name, select this option.
KillProcessByID—If you selected one of the immediate options in the In-Script Execution setting and you want to kill a process that has a particular process identifier (PID), select this option.
KillProcessDeferred—If you selected one of the deferred, commit, or rollback options in the In-Script Execution setting and you want to kill a process that has a particular name, select this option.
KillProcessByIDDeferred—If you selected one of the deferred, commit, or rollback options in the In-Script Execution setting and you want to kill a process that has a particular PID, select this option.

For information on configuring this type of custom action, see Calling a Kill-Process Custom Action.

PowerShell File Name

Note: This setting applies to PowerShell custom actions that are stored in the Binary table.

Select the PowerShell script file (.ps1) in the list of files that are stored in the Binary table or that are included in your project. If the location that you specified is stored in the Binary table, you can click this ellipsis button (...) in this setting to browse to the file.

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

PowerShell Script FileKey

Note: This setting applies to PowerShell custom actions that use a PowerShell script that is installed with the product.

To specify the PowerShell script file (.ps1) that you want to use for your custom action, select the file from the list of PowerShell files that are included in your project.

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

WiseScript Executable

Note: This setting applies to WiseScript custom actions.

Edition: This custom action type is available in the version of InstallShield that is included in certain editions of AdminStudio.

Enter the path to the WiseScript executable file that you would like to use for your custom action. As an alternative, you can click the ellipsis button (...) to browse to it.

Return Processing

Specify how the custom action thread should be processed. Valid options are:

Asynchronous (No wait for completion)
Asynchronous (Wait for exit code)
Synchronous (Check exit code)
Synchronous (Ignore exit code)

These flags are used to specify that the main and custom action threads run synchronously (the installer waits for the custom action thread to complete before resuming the main installation thread) or asynchronously (the installer runs the custom action simultaneously as the main installation continues).

Note that some options are not applicable to some types of custom actions. Only options that pertain to the selected type of custom action are available in this list.

In-Script Execution

Select which iteration of the sequence will trigger your action. For details about each option, see In-Script Execution.

These options copy the action code into the execution, rollback, or commit script. If you select a Terminal Server Aware option, the custom action impersonates the user during per-machine installations on terminal server machines.

Execution Scheduling

Specify how many times you want the action to run. For example, if an action is listed in both the user interface and execute sequences, it can be set to run both times, or it can run only once. Available options are:

Always execute—The action runs every time it is encountered. Therefore, it could run in the user interface sequence and again in the execute sequence.
Execute only if running on client after UI sequence—The action runs only if the execute sequence is run after the user interface sequence.
Execute only once—The action runs only once—even if it exists in both the user interface and execute sequences. The action is skipped in the execute sequence if the user interface sequence has run.
Execute only once per process—The action runs once per process if it exists in both the user interface and execute sequences. If the execute sequence runs in the same process as the user interface sequence, the installation skips this action in the execute sequence. This scheduling lets you avoid rerunning actions that modify session state such as properties.

If you selected anything other than Immediate execution in the In-Script Execution setting, the Execution Scheduling setting is not available and is set to Always execute.

Project: The Execute only once option does not work for InstallScript MSI projects. If your custom action exists in both the user interface and execute sequences, it is executed twice. This is because—in an InstallScript MSI project—the InstallScript engine executes the user interface sequence and Windows Installer executes the execute sequence.

Silent Mode

Note: This setting applies to standard DLL custom actions.

Specify whether you want the installation to suppress a warning message if the custom action fails to load the DLL file and call the function.

MSI Type Number

This read-only setting identifies the Windows Installer numeric value for the selected custom action. For more information about basic custom action types, see Custom Action Type Overview.

Comments

Enter any internal comments that you want to record for this custom action. These comments are for your reference only and are not displayed to end users.

Help File Path

Click the ellipsis button (...) to browse to the file that describes the behavior of the custom action. The file should be a text-based file such as a .txt, .htm, or .rtf file.

At build time for Basic MSI, DIM, InstallScript MSI, and Merge Module projects, InstallShield streams the contents of this file into the Description column of the ISCustomActionReference table.

If you are working on a project in Direct Edit mode, InstallShield streams the contents of the file that you select into the Description column of the ISCustomActionReference table as soon as you select the help file. In addition, InstallShield makes this setting read-only and displays [Text Data] as the value for this setting.

For any built-in InstallShield custom actions, InstallShield makes this setting read-only and displays InstallShield Custom Action as the value.

Run During Patch Uninstall

Project: If you are working on a project in Direct Edit mode, this setting is not applicable unless the database schema is a minimum of 405 (for Windows Installer 4.5 or later).

Specify whether Windows Installer should run the custom action only when a patch is being uninstalled. You can select Yes for a custom action in an .msi package. You can also select Yes for a new custom action that is added by a patch. However, Yes should not be selected for a custom action that is being added or removed by a patch to an existing custom action. The default value for this setting is No.

When Windows Installer 4.5 runs the patch uninstall custom action, it uses the custom action in the patch that is being uninstalled.

Note: Windows Installer 4.5 includes support for this setting, but Windows Installer 4.0 and earlier do not. Therefore, if you select Yes for this setting and some target systems may have Windows Installer 4.0 or earlier, add a condition to this custom action to prevent Windows Installer 4.0 and earlier from running it. Otherwise, Windows Installer 4.0 and earlier would call the custom action during the installation, repair, or update of the package.

For the condition, use the MSIPATCHREMOVE property. For more information, see MSIPATCHREMOVE in the Windows Installer Help Library.

Sequence Area Settings

The following custom action settings are available in the Sequence area.

Custom Action Settings in the Sequence Area

Setting

Description

Install UI Sequence

To schedule this custom action during the user interface sequence of the installation mode, select the appropriate option. To leave this custom action out of the sequence, select <Absent from sequence>.

As an alternative, you can schedule an action by dragging it 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. To move it to a different point in a sequence (or from one sequence to another), drag it from the old location and drop it onto the item that should be directly before it in the sequence.

Install UI Condition

If you want to specify a condition that Windows Installer must evaluate before running the custom action during this sequence on target systems, enter the conditional statement in this setting. The custom action does not run if the condition evaluates to false.

As an alternative to manually entering a statement, you can click the ellipsis button (...) in this setting to launch the Condition Builder dialog box, which simplifies the process of creating a condition.

For more information, see Building Conditional Statements.

Install Exec Sequence

To schedule this custom action during the execute sequence of the installation mode, select the appropriate option. To leave this custom action out of the sequence, select <Absent from sequence>.

As an alternative, you can schedule an action by dragging it 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. To move it to a different point in a sequence (or from one sequence to another), drag it from the old location and drop it onto the item that should be directly before it in the sequence.

Install Exec Condition

If you want to specify a condition that Windows Installer must evaluate before running the custom action during this sequence on target systems, enter the conditional statement in this setting. The custom action does not run if the condition evaluates to false.

As an alternative to manually entering a statement, you can click the ellipsis button (...) in this setting to launch the Condition Builder dialog box, which simplifies the process of creating a condition.

For more information, see Building Conditional Statements.

Advertise Exec Sequence

To schedule this custom action during the execute sequence of the advertisement mode, select the appropriate option. To leave this custom action out of the sequence, select <Absent from sequence>.

As an alternative, you can schedule an action by dragging it 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. To move it to a different point in a sequence (or from one sequence to another), drag it from the old location and drop it onto the item that should be directly before it in the sequence.

Advertise Exec Condition

If you want to specify a condition that Windows Installer must evaluate before running the custom action during this sequence on target systems, enter the conditional statement in this setting. The custom action does not run if the condition evaluates to false.

As an alternative to manually entering a statement, you can click the ellipsis button (...) in this setting to launch the Condition Builder dialog box, which simplifies the process of creating a condition.

For more information, see Building Conditional Statements.

Admin UI Sequence

To schedule this custom action during the user interface sequence of the administration mode, select the appropriate option. To leave this custom action out of the sequence, select <Absent from sequence>.

As an alternative, you can schedule an action by dragging it 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. To move it to a different point in a sequence (or from one sequence to another), drag it from the old location and drop it onto the item that should be directly before it in the sequence.

Admin UI Condition

If you want to specify a condition that Windows Installer must evaluate before running the custom action during this sequence on target systems, enter the conditional statement in this setting. The custom action does not run if the condition evaluates to false.

As an alternative to manually entering a statement, you can click the ellipsis button (...) in this setting to launch the Condition Builder dialog box, which simplifies the process of creating a condition.

For more information, see Building Conditional Statements.

Admin Exec Sequence

To schedule this custom action during the execute sequence of the administration mode, select the appropriate option. To leave this custom action out of the sequence, select <Absent from sequence>.

As an alternative, you can schedule an action by dragging it 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. To move it to a different point in a sequence (or from one sequence to another), drag it from the old location and drop it onto the item that should be directly before it in the sequence.

Admin Exec Condition

If you want to specify a condition that Windows Installer must evaluate before running the custom action during this sequence on target systems, enter the conditional statement in this setting. The custom action does not run if the condition evaluates to false.

As an alternative to manually entering a statement, you can click the ellipsis button (...) in this setting to launch the Condition Builder dialog box, which simplifies the process of creating a condition.

For more information, see Building Conditional Statements.

For more information about these settings, see CustomAction Table in the Windows Installer Help Library.

See Also