User Guide
408
Conditions
• The name of the property. This is case-sensitive. You do not need to enclose the
property name in square brackets. See Using Properties in Conditional
Statements in the Windows Installer SDK Help.
• Any integer between -32,767 and 32,767. You cannot use floating point values.
• String literal. Enclose text in quotation marks. Example: “Windows NT 4.0”.
Properties that have not been set evaluate to an empty string “” (null).
• Environment variable. Precede the variable name with a percent symbol (%).
! If a property is set, it evaluates to true in a Boolean expression.
Example: If the installation runs on a destination computer whose operating system
is Windows NT, Windows 2000, or Windows XP, the property VersionNT is set to the
version number of the operating system. However, if you want to set a condition to
check for these operating systems, you can enter the condition as VersionNT. If
VersionNT is set to anything at all, even 0, the condition evaluates to true.
! When adding conditions to the Launch Conditions icon, you can add conditions that
check properties or environment variables, but you cannot add conditions that check
the installed state of a component or feature.
! You might need to include the merge module CondFix.msm, provided by Wise
Solutions, that fixes certain Windows Installer limitations related to component
conditions. See WiseFixConditions on page 409.
! Property names and values, by default, are case-sensitive. To make them case-
insensitive, precede the operator with ~= instead of =.
Example: If you enter the condition REMOVE=ALL but the value of the REMOVE
property is currently “All” (with upper- and lowercase), the condition is false. To write
the condition so that it is case-insensitive, type the condition as follows:
REMOVE~=”All”
! Environment variable names are not case-sensitive.
! Non-existent property values are treated as empty strings and evaluate to false.
! Operators and precedence are the same as in the BASIC and SQL languages, but you
can override precedence with parentheses.
! Arithmetic operators and floating point numeric values are not supported.
For details, see Conditional Statement Syntax in the Windows Installer SDK Help.
Examples of Conditions
You can build conditions using property names, environment variables, and feature and
component states. Conditions can contain both Windows Installer properties and
properties that you create. A complete list of Windows Installer properties is available in
Property Reference in the Windows Installer SDK Help.
Condition The Condition Is True If
SystemLanguageID=1033 The installation is running on a computer whose
language is set to English.
REMOVE~=”ALL” The product is being uninstalled. The ~ makes the
condition case-insensitive.
NOT Installed The product is being installed for the first time.