Setting Product Conditions
InstallShield 2019
Project • This information applies to the following project types:
The Installation Requirements page in the Project Assistant lets you specify some commonly used installation requirements for the target system. For example, if your application requires a specific operating system in order to run properly, you can indicate that on the Installation Requirements page.
InstallShield also enables you to define your own custom conditions that Windows Installer must evaluate before your product can be installed. Conditions that you create in the General Information view and on the Installation Requirements page in the Project Assistant apply to the entire product; if one or more of the conditions are false on the target system, the installation exits and an error message is displayed.
For example, if your product requires 64 MB of RAM in order to run properly, you can use the Product Condition Builder dialog box to create a condition. At run time, the Windows Installer checks the target system to determine how much RAM is installed. If it is less than 64 MB, or if any of the other product conditions are false, the Windows Installer displays an error message and exits the installation.
Tip • You cannot guarantee the order in which Windows Installer evaluates product launch conditions. If it is necessary to control the order in which the conditions are evaluated, you can create an error custom action in the Custom Actions and Sequences view for each condition, and schedule them in the appropriate order.
To create a custom launch condition for your product’s installation:
|
1.
|
In the View List under Installation Information, click General Information. |
|
2.
|
Click the Install Condition setting and then click the ellipsis button (...). The Product Condition Builder dialog box opens. |
|
3.
|
Click the New Condition button. InstallShield adds a new condition row to the Conditions box. |
|
4.
|
Do one of the following: |
|
•
|
In the Condition column, type the launch condition. |
|
•
|
Use the Properties list, the Operators list, and the Add buttons to build your conditional statement: |
|
a.
|
In the Properties list, select a property and then click the Add button. InstallShield adds the property to the Condition column. |
|
b.
|
If your conditional statement should contain an operator, select an operator in the Operators list and then click the Add button. InstallShield adds the operator to the conditional statement. |
|
c.
|
If your conditional statement should contain a value, double-click the condition field, press END so that the insertion point is at the end of the condition statement, and enter the value. |
|
5.
|
In the Message column, enter the error message that you would like to be displayed if the condition evaluates to false. |
When you type a value for this column, you are creating a string entry and setting its initial value for all of the languages that are currently in the project. As an alternative to typing a new value, you can double-click this setting and then click the ellipsis button (...) in this setting to select an existing string. For more information, see Using String Entries in InstallShield.
Note • Windows Installer dialogs, which display the text that you specify in the Message column, do not recognize the escape sequences \r (carriage return), \n (new line), or \t (tab).
Important • InstallShield performs basic condition validation; however, you should still double-check that your condition statements evaluate to the expected outcome. For more information and example conditions, see Building Conditional Statements.
See Also
Conditional Statement Syntax (Windows Installer Help Library)
Installation Requirements Page
Product Condition Builder Dialog Box
Conditional Statement Syntax
Open topic with navigation