Windows Installer Editor Reference
455
Using MSI Script
Restricted Areas in the Sequence
z
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.
z
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
z
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.
z
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.
Guidelines for Custom Action Conditions
Place a custom action between conditional If Statements to run it only if a certain
condition is true. A condition can check whether the product is installed, the value of a
property is true, if specific system requirements are met, and more.
See
Conditions
on page 387 and Conditional Statement Syntax in the Windows Installer
SDK Help.
To Run Only During Initial Installation
The Execute sequences under the Normal Installation mode run during initial installation
and later during maintenance and uninstall installations. To run a custom action during
the initial installation only, set its condition to NOT Installed. Installed is a Windows
Installer property that is true if the product is installed.
Example: If you add a custom action that opens a Readme file and set the action’s
condition to NOT Installed, then the Readme opens during initial installation, but does
not open during maintenance installations (reinstall, modify, and repair operations).
To Run Only During Uninstall
If the product is being uninstalled, the REMOVE property is set to All or ALL. To run a
custom action during uninstall only, set its condition to REMOVE~=”ALL”. (The ~ causes
the comparison to be case-insensitive.)
Guidelines for Nested Installation Custom Actions
You can call another installation from within the running installation with an Install MSI
custom action. Use this type of custom action to deploy or uninstall one product from
within the installation of another product. See Nested Installation Actions in the
Windows Installer SDK Help.