Custom Action Type 18

Windows Installer

Custom Action Type 18

This custom action calls an executable launched with a command line.

Source

The executable is generated from a file installed with the application. The Source field of the CustomAction table contains a key to the File table. The location of the custom action code is determined by the resolution of the target path for this file; therefore this custom action must be called after the file has been installed and before it is removed.

Type Value

Include the following value in the Type column of the CustomAction table to specify the basic numeric type.

Constants Hexadecimal Decimal
msidbCustomActionTypeExe + msidbCustomActionTypeSourceFile 0x012 18

 

Target

The Target column of the CustomAction table contains the command line string for the executable identified in the Source column.

Return Processing Options

Include optional flag bits in the Type column of the CustomAction table to specify return processing options. For a description of the options and the values, see Custom Action Return Processing Options.

Execution Scheduling Options

Include optional flag bits in the Type column of the CustomAction table to specify execution scheduling options. These options control the multiple execution of custom actions. For a description of the options, see Custom Action Execution Scheduling Options.

In-Script Execution Options

Include optional flag bits in the Type column of the CustomAction table to specify an in-script execution option. These options copy the action code into the execution, rollback, or commit script. For a description of the options, see Custom Action In-Script Execution Options.

Return Values

Custom actions that are executable files must return a value of 0 for success. The installer interprets any other return value as failure. To ignore return values, set the msidbCustomActionTypeContinue bit flag in the Type field of the CustomAction table.

Remarks

A custom action that launches an executable takes a command line, which commonly contains properties that are designated dynamically. If this is also a deferred execution custom action, the installer uses CreateProcessAsUser or CreateProcess to create the process when the custom action is invoked from the installation script.

Custom actions that reference an installed file as their source, such as Custom Action Type 18 (EXE), must adhere to the following sequencing restrictions:

  • The custom action must be sequenced after the CostFinalize action. This is so that the custom action can resolve the path needed to locate the EXE.
  • If the source file is not already installed on the computer, deferred (in-script) custom actions of this type must be sequenced after the InstallFiles action.
  • If the source file is not already installed on the computer, non-deferred custom actions of this type must be sequenced after the InstallFinalize action.

See Also

Custom_Actions
Executable Files

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.