User Guide
115
Features Page
Using Conditions With Features
You can add conditions to features to specify different actions based on installation
properties, system configuration, end user choices, and so on. Both conditions and
features are listed in the Current Feature drop-down list, which appears on all
Installation Expert pages in the Feature Details page group. Just as you can specify
options on a per-feature basis, you can also specify options on a per-condition basis.
Options on these pages that you associate with a condition are installed only if the
condition is true and the feature is installed.
Example:
Suppose your core application files are stored in a feature named Application. If your
application is installed on Windows 95, 98, or Me, you want to also install
Application9x.dll, but if your application is installed on Windows NT, 2000, or XP, you
want to install ApplicationNT.dll. You do not want to install both .DLLs, but instead want
to install one or the other based on the version of the operating system. To do this, you:
! Add 2 conditions under the Web_Creator feature, Version9X (which specifies an OS
of Windows 95, 98, or Me) and VersionNT (which specifies an OS of Windows NT,
2000, or XP).
! On the Files page, select the VersionNT condition from the Current Feature drop-
down list, then add the ApplicationNT.dll file.
! On the Files page, select the Version9X condition from the Current Feature drop-
down list, then add the Application9x.dll file.
During installation, the files contained within the conditions are installed only if the
condition is true.
Version9X and VersionNT are properties that are set by Windows Installer. See
VersionNT Property and Version9X Property in the Windows Installer SDK Help.
Also see:
WiseFixConditions on page 409
Adding and Deleting Feature Conditions
To add a new condition to a feature:
1. Select Installation Expert > Features page
2. Click a feature name.
3. Click Add Condition at the right of the Features page.
The Feature Condition dialog appears.
4. Click Build, and create your condition in the Condition Builder dialog.
The Condition Builder dialog lets you construct a conditional expression and check
its syntax. For details, see Creating Conditions With Condition Builder on page 409.
Note
If you add a component condition that checks the installed state of a component or
feature, add the merge module CondFix.msm to the installation. This merge module fixes
a Windows Installer limitation. For details, see WiseFixConditions on page 409.
5. Click OK in the Feature Condition dialog.