Windows Installer Editor Reference
491
Custom Action Reference
Note
The In-Script Options drop-down list is unavailable 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
unavailable for Set Property and Set Directory because they must be run in immediate
execution mode in order to work.
z
Immediate Execution
If you place an action in the User Interface or Execute Immediate sequence, this is
set to Immediate Execution and is unavailable, because those two sequences always
run in immediate execution. This action will be executed during the first pass that
Windows Installer makes 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 unavailable.
z
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.
z
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
changes to the system. Rollback actions run in deferred execution mode and cannot
run asynchronously. See Rollback Custom Actions in the Windows Installer SDK
Help.
z
Commit only
Select this if the action should be executed later, during installation of the commit
script, which is invoked upon successful completion of the installation script.
Commit actions run in deferred execution mode. See Commit Custom Actions in the
Windows Installer SDK Help.
z
Deferred Execution - System Context
If execution of the custom action requires elevated privileges, set this option. You
must also set AlwaysInstallElevated keys in the registry. See AlwaysInstallElevated
in the Windows Installer SDK Help. This makes the custom action run as though it
were logged on as a system account, similar to the way services can log on as a
system account.