Rules Reference

InstallAnywhere 2018

Rules can be configured and attached to nearly any element of the installer: an Action or Action Group, a Component or Feature, or the entire installer itself. Rules return either a true or false value depending on the state of the computer running the installer. For example, a Check Platform rule can be set to evaluate to true only if the installer is being run on Solaris. This rule can then be attached to a Solaris-specific binary file that has no business being installed on a Windows-based or macOS or OS X–based platform.

When you add multiple rules, you can build complex rule expressions that use multiple logical operators—including AND (&&), OR (||), and NOT (!)—and precedence operators (parentheses) to express the relationship between two or more rules. By default, rules are joined by the AND operator. For more information, see Building Complex Rule Expressions.

Tip • When a rule is attached to an action, the installer evaluates the rule before the action runs. Therefore, you cannot check the result or return value of an action with a rule you attach to that action. If you want to check the return value of an action, you must do so in a rule attached to a subsequent action.

Built-in Rules

Rule

Description

Check File/Folder Attributes Rule

This rule allows developers to check the attributes of a file or directory that already exists on the target system. Developers can check if the object exists, whether it is a file or a folder/directory, and whether it is readable or writable.

The in-use/not in-use options are tested on Windows systems only.

Check If File/Folder Exists Rule

This rule applies to individual file/folder install actions.

The Check if File/Folder Exists rule checks if the file or folder to which it is attached already exists in the specified install location. Developers can decide to install if it does exist or does not exist at that location.

Check Platform Rule

The Check Platform rule allows developers to specify action or files to be run/installed only on specific platforms. Developers can choose platforms from the default list or define custom platforms using character strings or regular expressions. The platform of the target machine is determined by the Java virtual machine and reported to the installer.

Check Running Mode Rule

The Check Running Mode rule enables you to customize the events that occur when an end user launches maintenance mode. This rule also lets you customize the events that you want to occur when the installer is running in upgrade mode.

Check System Architecture Rule

The Check System Architecture rule allows developers to specify action or files to be run/installed only on specific system architecture (32-bit or 64-bit). The system architecture is normally determined by the Java virtual machine and reported to the installer, but in some cases may be specified in a registry action.

Check User-Chosen Language Rule

Developers can use Check User-Chosen Language to make installation decision based on the locale chosen by the end user at installation time.

Compare File Modification Timestamp Rule

This rule allows developers to compare the timestamp of an existing target file in order to make an overwrite decision.

Compare InstallAnywhere Variables Rule

This rule allows developers to make a simple string comparison of any InstallAnywhere variable. Developers can check if a variable equals, does not equal, contains, or does not contain a value.

Compare InstallAnywhere Variables Numerically Rule

Use to compare two InstallAnywhere variables numerically or to compare an InstallAnywhere variable against a specific value.

Compare Versions

Use to compare two version numbers during an installation.

Evaluate Custom Rule Rule

Custom rules built using the specifications outlined in the InstallAnywhere API can be tailored to fit the needs of the installation.

Match Regular Expression Rule

The Match Regular Expression rule allows developers to compare a string, or InstallAnywhere Variable to a regular expression of the developers choosing. Regular Expressions (regexp) are an industry-standard method of expressing a variable string. Developers can find considerable information on regular expressions, including archives of use full expressions, and web applications that can be used to verify the validity of the expression on the Web.

The Match Regular Expression Rule uses the java.util.regex library. For more information, see:

https://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html 

System i (i5/OS) Licensed Program Exists Condition Rule

This rule allows developers to determine if a licensed program, matched by the Licensed Program Identifier, Option, and Release Level, exists on the target i5/OS system. Any action to which this rule is assigned can be conditionally performed based on whether a matching licensed program is found or not found on the i5/OS system.

System i (i5/OS) Primary Language Install Condition Rule

This rule allows developers to compare one or more primary language settings with the primary language of a target i5/OS system. Any action to which this rule is assigned can be conditionally performed based on whether the primary language was matched on the target i5/OS system.

System i (i5/OS) Program Temporary Fix (PTF) Condition Rule

This rule allows developers to determine if a PTF, matched by the Licensed Program Identifier, PTF ID, Release Level, and PTF Status, exists on the target i5/OS system. Any action to which this rule is assigned can be conditionally performed based on whether a matching PTF is found or not found on the i5/OS system.

See Also