Conditions
The conditions in this chapter use the Condition
element to house their logic. The meaning of this element changes depending on where it's placed relative to other elements and which attributes it uses. We'll discuss three types: launch conditions, feature conditions, and component conditions.
Launch conditions check for prerequisites at the beginning of the installation and prevent it from continuing if their requirements aren't met. They're placed anywhere inside either the Product
element in your main .wxs
file or a Fragment
element in a separate file.
Feature conditions and component conditions are child elements to Feature
and Component
elements, respectively. Both prevent a specific feature or component from being installed if a condition isn't satisfied.
First, we'll take a look at the generic syntax of conditional statements and then move on to discussing each of the three types.
Condition syntax
Conditions contain statements that evaluate to either true or false. In most...