Custom Action Types

[This is preliminary documentation and subject to change.]

The custom action type is specified by a numeric value in the Type column of the CustomAction table. The following tables describe how to indicate the type.

Formatted Text

The following table describes the values as well as the meaning of the Source and Target columns of the CustomAction table for these types of custom actions. A custom action that sets a property or directory with formatted text cannot use the options described in subsequent tables.

Numeric Value Description Source Target
51 Property set with formatted text Property name String to be formatted
35 Directory set with formatted text Key into the Directory table String to be formatted

Executable, DLL, or Script

A custom action can also be an executable file, a dynamic-link library, or a script. These custom actions are composed of a source type, an executable type, and option flags. To indicate these types, select one number from each of the following tables, add the values together, and enter the resulting number in the Type column of the CustomAction table. Note that the meanings of the other columns in the CustomAction table vary depending on the options. See the table describing the Location options for more information.

The installer does not provide the script engine but can use it if it is installed. Authors wishing to make use of a scripting language during installation should be certain that the appropriate scripting engine is available.

Source Type

The following table describes the action type options.

Numeric Value Description
1 The action is a DLL.
2 The action is an .exe file.
5 The action is Microsoft® JScript™, source.
6 The action is Microsoft® Visual Basic® Scripting Edition (VBScript) source.

Location

The following table shows the custom action source options along with the corresponding meanings of the Source and Target columns of the CustomAction table. If an entry in the table is blank, it is the same as the entry directly above it.

Numeric Value Description Source Target
0 The data is stored in the Binary table. Key into the Binary table. For a DLL; the DLL entry point.
For an EXE; the command line options.
For a script; an optional function to call.
16 The file is copied during installation. The file is listed in the File table. Key into the File table. Same as for a source option of 0.
32 For an EXE file, the location of the folder containing the existing file is given in the Directory table. Key into the Directory table. The executable name and command line options.
For a script, the script itself is stored in the Target column of the CustomAction table. Null The script source.
Not allowed for a DLL.
48 For an EXE file, a property holds the full path to the executable. Property name, key into the Property table. Same as for a source option of 0.
For a script, the property holds the source of the script itself.
Not allowed for a DLL.

Synchronous or Asynchronous Execution

The following table describes the custom action processing options.

Numeric Value Description
0 Synchronous execution; must return exit code.
64 Synchronous execution; exit code is ignored.
128 Asynchronous execution; wait for exit code at sequence end.
192 Asynchronous execution; wait for exit code at install termination.

Scheduling Options

The following table describes the custom action scheduling options.

Numeric Value Description
0 Run action when the installer reaches it during database processing.
256 Run action at the appropriate stage during install script processing.
512 Run action only during install rollback.