Guidelines for Custom Action Location

created the topic: Guidelines for Custom Action Location
General
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.
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.
If the installation is run silently, items in the User Interface sequence do not execute.

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 in order to run
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.

Restricted Areas

* If an action has restrictions on its placement in the sequence, the restricted areas are shaded in the Installation Sequence list when you select the action in the Actions list. Place the action in a non-restricted area. Restrictions are defined by Windows Installer functionality. Example: You can’t run an action that depends on an installed file if the file is not yet installed.
* If you use the Move Up and Move Down commands on a custom action that has restricted placement, keep in mind that the restricted areas will not be shaded. Before moving an action, select the action in the Actions list to view its restricted areas.
* Formatted Text
* If you use formatted text in a custom action, such as a bracketed property name, the custom action must be placed after the CostFinalize action in the User Interface sequence. This is a Windows Installer requirement.
* If you use formatted text in a custom action, do not put the custom action in the Execute Deferred sequence. Formatted text strings do not convert in the Execute Deferred sequence. The exceptions to this rule are the CustomActionData and ProductCode properties. See Formatted and Obtaining Context Information for Deferred Execution Custom Actions in the Windows Installer SDK Help.

Rajesh Kumar
Follow me
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x