User Guide

534
Using the Custom Action Properties Tab
Using the Custom Action Properties Tab
The Properties tab appears on the details dialog for most custom actions. However,
sometimes options are disabled or display different choices based on what kind of
custom action you added and where you added it. In this dialog, you set options that
determine when and how the custom action is run.
In-Script Options
This determines when the custom action is executed. When Windows Installer runs the
installation, it first reads the action sequences and creates its own internal installation
script to follow, then later it executes that script. You can have the custom action
executed immediately when Windows Installer first encounters it, or later during
execution of the internal script. See Custom Action In-Script Execution Options in the
Windows Installer SDK Help.
Note
The In-Script Options drop-down list is disabled if this custom action is located in the User
Interface or Execute Immediate sequences because both these sequences already run in
immediate execution mode, making this drop-down list redundant. It is disabled for Set
Property and Set Directory because they must be run in immediate execution mode in order
to work.
! Immediate Execution
If you place an action in the User Interface or Execute Immediate sequence, this is
set to Immediate Execution and is disabled, because those two sequences always run
in immediate execution. This action will be executed during Windows Installer’s first
pass through the installation database, before the internal script is generated and
executed. Actions in immediate execution mode can change properties; actions in
any type of deferred mode cannot. Actions in immediate execution mode always run
under User Context, which means that they run with the same privilege level as the
currently logged-in user. If the custom action needs to be run under a higher
privilege level, place it in the Execute Deferred sequence and set this field to
Deferred Execution - System Context.
Note
The following four options all apply to deferred custom actions, and are available only if
the custom action is placed in the Execute Deferred sequence. Otherwise the drop-down
list is disabled.
! Deferred Execution - User Context
Select this if the action should be executed later during installation, during the time
when all other system changes are performed by Windows Installer. This runs under
user context, so if the current user doesn't have elevated privileges, and the action
needs elevated privileges to succeed, it might fail. Use this option if the custom
action depends on a file that is installed with the installation. Custom actions that
change the system directly should be run in Deferred Execution. Deferred custom
actions cannot change properties in the Property table. See Deferred Execution
Custom Actions in the Windows Installer SDK Help.
! Rollback only
Select this if the action should be executed later, during installation of the rollback
script, which is invoked if the end user cancels the installation or if the installation is
unsuccessful. Use rollback actions to undo previous custom actions that made