Revenera logo

By Debbie Landers

When you are creating a Suite installation in InstallShield, you may need to specify that certain conditions must exist on the target system. For example, if your product requires that certain registry keys exist, your installation may need to check the target system to ensure that this requirement is met. In some cases, if the requirement is not met, your installation might display an error to inform the end user about the requirement; in other cases, the Suite installation may skip a package in the Suite or list a feature as unselected for installation by default.

How Suite Installations Use Conditions

The Suite project type in InstallShield has support for building conditional statements that control different areas of the run time:

  • Exit conditions—The Exit Condition setting in the General Information view lets you specify one or more exit error messages that you want the Suite installation to display under various conditions before ending the installation. If the condition that you define is true when an end user launches the Suite installation, the Suite installation displays the error message. When end users dismiss the error message, the Suite installation ends.
  • Detection conditions—The Detection Condition setting for a package in the Packages view lets you specify the condition that the Suite installation should use to evaluate whether the package is already installed on target systems. If this does not change from false to true (or from true to false) at run time, the Suite installation assumes that the package failed to install (or remove) its payload.
  • Eligibility conditions—The Eligibility Condition setting for a package in the Packages view lets you specify the condition that the Suite installation should use to determine whether the target system meets the requirements that are necessary for the package to be run. For example, if the package should be run only on 64-bit systems, you could set up an x64 platform requirement in a condition; the Suite installation would launch the package only on 64-bit systems. You may also want to set up an eligibility condition to prevent end users from being able to install the current package version over a future newer version.
  • Feature conditions—The Condition setting in the Features view lets you build conditional statements to evaluate whether the feature should be selected for installation by default on the InstallationFeatures wizard page.
  • Mode conditions—InstallShield creates mode conditions automatically behind the scenes, based on the detection conditions of all of the primary packages in the Suite project. The Suite engine uses these conditions to determine whether the Suite installation runs as a first-time installation or in maintenance mode. For more information, review John Cresswell’s previous post on mode conditions in Suite installations.

Types of Condition Checks

When you are building a conditional statement for an exit, detection, eligibility, or feature condition in a Suite project, you can select from a number of different types of checks that you want to be evaluated on target systems. Examples are operating system version, presence of a file or registry entry, and presence of an already installed product.

For detailed information about each of the types of condition checks that are supported, as well as each of the subsettings that are displayed under a condition, see Building Conditional Statements in Suite Projects in the InstallShield Help Library.

Condition Operators

Each condition that you define in a Suite project begins with one of the following operators:

  • Any—An Any condition group operates like a logical OR operation. If any of the conditions that are in the Any group evaluate to true, the entire condition group evaluates to true. If none of the conditions that are in the Any group evaluate to true, the entire condition group evaluates to false.
  • All—An All condition group operates like a logical AND operation. All of the conditions that are in the All group must evaluate to true in order for the condition group to evaluate to true.
  • None—A None condition group operates like a logical NOR operation. If none of the conditions that are in the None group evaluate to true, the entire condition group evaluates to true. If any of the conditions that are in the None condition group evaluate to true, the entire condition group evaluates to false. Note that if the None condition group consists of only one conditional statement, it operates like a logical NOT operation.

Syntax for Building Conditions

Building a conditional statement involves using one or more of the condition settings to add operators and condition checks.

To add a conditional statement to a condition setting, click the setting’s New Condition button:

When you do that, InstallShield adds an operator row under the condition setting; the default operator is Any. To change the operator for the condition, click the drop-down arrow in the operator setting and then click the appropriate option.

Once you’ve added an operator, click the New Condition button in the operator setting and then click the appropriate condition check type. At this point, InstallShield adds a subsetting (or more subsettings, depending on which condition check type you selected) under the operator setting.

Whenever a conditional statement is invalid (for example, if an entry is required in a setting but it is left blank), InstallShield shows a warning icon in that setting. To find out why the condition is invalid, move the pointer over an icon; InstallShield displays a tooltip that explains the issue.

To nest another condition within a condition, click the New Condition button in an operator setting and then click the appropriate operator for the nested condition. One of the Any/All/None meta-conditions is referred to as a condition group. All of the nested condition groups and conditions under a condition setting together form a condition tree.

Note that if you add an .msi package to your project, InstallShield automatically creates two MSI Package eligibility condition groups for the package, and uses an asterisk in the condition’s Product Code, Package Code, and Product Version settings as placeholders for the package’s own product code, package code, and product version, as shown in the following screen shot.

InstallShield adds this built-in condition to prevent the Suite installation from launching the package if a package with a matching product code but a later product version is already installed. You can override this built-in condition if necessary.

You can use an asterisk as a placeholder for the current package’s product code and product version when you are defining eligibility and detection MSI package conditions, as long as the package that you are configuring is an .msi package.

InstallShield icon

InstallShield

Create native MSIX packages, build clean installs, and build installations in the cloud with InstallShield from Revenera.

You can also use an asterisk as a placeholder for the current package’s upgrade code and either the minimum or maximum version number when you are defining eligibility and detection MSI upgrade conditions, as long as the package that you are configuring is an .msi package.

What’s Next?

Hopefully, that’s enough background to get you started creating conditions in Suite projects. The Suite condition configuration in InstallShield is quite robust, which means that while it offers a lot of flexibility, it also makes it possible to build very complex condition trees, accounting for a lot of different possible scenarios.

In my next post, I’ll offer some essential best practice tips that you’ll want to keep in mind as you define your conditions. In the meantime, give the Suite condition support a try.

The ability to create Suite installations is available in InstallShield 2012 Premier Edition.