Поделиться через


Condition Property

Specifies a condition that must be satisfied (evaluate to True) at installation time on a target computer. The Condition property can be used to add conditional logic to an installer, for example, installing a file only for a specific operating system version. It can also be used in conjunction with a file, registry, or component search to terminate installation if a specified item is not found. The AlwaysCreate property must set to True, or the condition is not evaluated.

Note

Conditions apply to files and components, not to folders. You can set a condition on a folder, but the condition will be ignored unless the folder is empty and its AlwaysCreate property is set to True. In this case, a dummy component will be created for the folder and the condition will be set on that component.

Settings

The Condition property takes a string containing a valid conditional statement that can be evaluated as True or False. This statement can be a Windows Installer condition or property, the value contained in the Property property, the Name property of a file, registry, or component search, or a combination of the preceding statements using logical operators.

For example, your setup project contains a Checkboxes dialog with a checkbox called CheckBox1, and CheckBox1Property is CHECKBOXA1. To determine whether the user has selected CheckBox1, you could set the Condition Property to the expression CHECKBOXA1=1. For more information see the step "To add a launch condition to check the Internet Explorer version" in Walkthrough: Deploying a Windows-based Application.

The Condition property is used in conjunction with the setting of launch conditions as described in Launch Condition Management in Deployment.

See Also

Reference

Properties for the Launch Conditions Editor

Property Property

Property Property (Folders)

Using Windows Installer Properties

Windows Installer Conditional Statement Syntax

Other Resources

Launch Condition Management in Deployment