Control conditions allow you to dynamically update the enabled/disabled state of a control, based on a conditional expression that is automatically re-evaluated whenever one of its parts changes.
If you define a control condition for a control, it will be evaluated just before the parent dialog is shown.
The condition is also automatically re-evaluated if any of its parts changes while the parent dialog box is open; this allows dynamic control state changes. For example, this is how the Next PushButton control is re-enabled in the predefined LicenseDlg dialog box when the user clicks the I agree... CheckBox control (and disabled again if the I agree... box is cleared): it is linked to the UILicenseAgreed variable that is set or reset by the I agree... check box.
Tip: You can also change a control's visibility or enabled state by using a Set Window State action as an event handler elsewhere in the same dialog or as an action in any action sequence that runs while the parent dialog box is open.
Windows Installer also has Control
conditions; however, these are separate actions to change the state of
the control. The following table compares the two installers.
| Tarma Installer | Windows Installer | Remarks |
|---|---|---|
| Control condition attribute | Control condition |
Tarma's control conditions update the enabled/disabled state of their control with a single condition. Windows Installer's Control condition actions can show, hide, enable, or disable a control. However, each individual state change requires a separate condition (i.e., you must define both an Enable and a Disable condition to make state changes both ways). Both Tarma Installer and Windows Installer automatically re-evaluate the condition whenever a referenced variable changes. This allows for dynamic updating of the control's state. |
| Set Window State action | Control condition |
Tarma's Set Window State actions can be executed in dialog event handlers or as part of action sequences. They can show, hide, enable, disable, minimize, maximize, make read-only, make read/write or send messages to the control (or any other installer window). Set Window State actions may or may not be conditional, just like any installer action. Windows Installer's Control condition actions are always linked to a specific control and can show, hide, enable, or disable their control based on a condition. |