Open topic with navigation
How Rules Are Evaluated at Run Time
InstallAnywhere 2013
When an installer is run, rules get evaluated multiple times and at points in the sequence that are much earlier than where the rule is actually located. This may be important to consider because a rule could be referring to an InstallAnywhere variable that has not yet been set at the point when the rule is evaluated, which may cause the rule to fail—especially in custom rules. You may want to evaluate this to ensure that the rule’s parameters (InstallAnywhere variables) are set correctly.
The number of times and when each rule will be evaluated depends upon where the rule is placed in the InstallAnywhere project. For example, if you have a rule on a component, whenever that component is referenced, the rule is evaluated. Even if a file (not a component) is being installed, the rules of all of that file’s parents, including the component, is evaluated.
Suppose you have the following hierarchical structure of items:
When this installer is run, the following would occur:
|
•
|
Rule RC would be evaluated once, just when Item C is installed. |
|
•
|
Rule RB would be evaluated twice: once when Item B is installed, and again when Item C is installed. |
|
•
|
Rule RA would be evaluated three times: once when Item A is installed, then when Item B is installed, and a third time when Item C is installed. |
Note: This example assumes that Items A, B, and C do not have any other elements assigned to them.
Regarding when and how many times a rule is evaluated, also note the following:
|
•
|
Panels—In case of panels, the rule is evaluated once during the preflight of all panels at install start, and during the uninstall start. The rules of the panel are also evaluated each time the panel is about to be visited. |
|
•
|
OR based conditions—The rules on the installer are visited once during install start. However, if you have any OR-based conditions, then the rules are evaluated for every panel and every action. |
Tip: If you are unsure as to when an InstallAnywhere variable that you are using is populated, you may want to consider using a Compare InstallAnywhere Variable rule along with your custom rule.