Windows Installer Editor Reference
388
Using Conditions and Properties
condition or feature. These changes can include adding files, registry entries, services,
and ODBC.
Items that you add to a feature are installed on the destination computer only if the
feature is installed. Items that you add to a condition are installed only if the feature is
installed and the condition is true.
See
Using Conditions With Features
on page 100.
Conditions for actions
You can set conditions on the actions in MSI Script by using If Statements. MSI Script
contains standard Windows Installer actions, dialog boxes, and custom actions. In
general, you should not set or change conditions for standard actions, but you’ll
probably set conditions for any custom actions or dialog boxes you create.
See
About MSI Script
on page 440 and
Guidelines for Custom Action Conditions
on
page 455.
Launch conditions
Launch conditions are system requirements that must be met for the installation to
proceed. You set launch conditions in the Launch Conditions icon in Setup Editor >
Product tab. When you set system requirements on the System Requirements page,
they are added to the Launch Conditions icon.
Example of a possible launch condition:
ScreenX >= 800 AND ScreenY >= 600
This condition specifies that the screen resolution must be 800 x 600 in order for the
installation to proceed.
ScreenX and ScreenY are Windows Installer properties that are set according to the
screen resolution on the destination computer. See ScreenX Property and ScreenY
Property in the Windows Installer SDK Help.
Conditions for controls on dialog boxes
In Setup Editor > Dialogs tab, you can use conditions with dialog box controls. Controls
are the items that appear on dialog boxes, such as text boxes, radio buttons and check
boxes. Because many conditions are already set on the default installation dialog boxes,
you can use those for examples of how you might use conditions in dialog boxes. View
them in Setup Editor > Dialogs tab.
z
Conditions that set the state of controls
You can create a condition that sets a control to be enabled, disabled, shown,
hidden, or set as the default control.
Example: If you double-click the Next button on the License dialog in Setup Editor >
Dialogs tab, then on the Conditions tab on the Properties dialog box you see three
conditions attached to the Next button. These conditions determine the state of the
Next button. They are all based on the value of a property named Accept. The
Accept property is set to “Yes” when the end user clicks the I accept the license
agreement radio button. As soon as Accept equals “Yes”, the Next button becomes
enabled and set to the default control. (To see how the Accept property is set,
double-click the radio buttons on the License dialog, then view the Items tab on the
Properties dialog box.)