Windows Installer Editor Reference
505
Using MSI Script
Guidelines for Custom Action Location
General
z
Place the custom action as high in the sequence as possible where it executes
properly. If it doesn’t execute properly when you test it, keep moving it lower in the
sequence until it works.
z
If the custom action uses information that’s gathered during the User Interface
sequence, place it after the actions that gather the information you need.
z
If the installation is run silently, items in the User Interface sequence do not
execute.
Note
The User Account Control (UAC) that was introduced with Windows Vista affects the
execution of custom actions that access protected areas on the destination computer.
You might need to elevate part or all of the installation to prevent the failure of such
custom actions.
See
About UAC Elevation of Windows Installer Installations
on page 200.
Correct Sequence
If the action does this
Place it in this sequence
Gathers input from an end user
User Interface
Needs to change properties
User Interface or Execute Immediate
Is an Install MSI custom action
Execute Immediate
Is to be executed sometime during the
installation of files
Execute Immediate or Execute Deferred
Place it between the InstallInitialize and
InstallFinalize actions, near the InstallFiles
action. The InstallFiles action installs files
during deferred mode.
Makes a change to the system
Execute Deferred
Depends on a previous action
Execute Deferred
Windows Installer does not perform the
action when it runs in Immediate mode. If
a custom action depends on a change to
the system, and the change has not yet
been made, the custom action fails.
Requires elevated privileges to run
Execute Deferred
Actions run in Deferred mode can be run
under the system context. See the
description of the In-Script Options field
in
Using the Custom Action Properties Tab
on page 542.