User Guide
406
Conditions
Conditions
Conditions are like expressions: they evaluate to a true or false value. You associate
conditions with different elements of an installation such as features, components,
actions, dialogs, and dialog controls to determine whether something happens or not.
Based on whether the condition is true or not, you can determine whether to:
! Allow the installation to continue.
! Install certain features and components.
! Display certain dialogs or dialog controls.
! Execute custom actions you add in MSI Script.
When you create a new installation, conditions are already created throughout the
installation where appropriate.
You often use properties inside conditions. Properties are named values either defined
by Windows Installer, by Wise Solutions, by you in the installation file, by the end user
during installation, or based on the system configuration of the destination computer.
See Properties on page 414.
Where Can You Use Conditions?
Conditions on the Features Page
You can add conditions on the Features page. These conditions appear in the Current
Feature drop-down list that appears at the top of pages in the Feature Details page
group. Using the Current Feature drop-down list, you can add system changes to a
condition or feature. These changes can include adding files, registry entries, services,
and ODBC. Items you add to a feature are only installed on the destination computer if
the feature is installed. Items you add to a condition are only installed if the feature is
installed and the condition is true.
See Using Conditions With Features on page 115.
Conditions for Actions
You can set conditions on the actions in MSI Script by using If Statements. MSI Script
contains standard Windows Installer actions, dialogs, 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 dialogs you create. See Using MSI Script on
page 486 and Guidelines for Custom Action Conditions on page 500.
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 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.