Configuring Validation for a Control on a Wizard Page or Window

InstallShield 2016

Project • This information applies to the following project types:

Advanced UI
Suite/Advanced UI

Edition • The Advanced UI project type is available in the Professional edition of InstallShield. The Suite/Advanced UI project type is available in the Premier edition of InstallShield. For information about the differences between these two project types, see Advanced UI Projects vs. Suite/Advanced UI Projects.

InstallShield lets you implement validation for some of the various wizard interface controls. For example:

You can ensure that end users enter a serial number in a text box in a specified format.
You can configure validation for a text box control to check whether the folder an end user specifies in the text box is valid.
You can prevent end users from selecting certain combinations of check boxes that do not work together.

Validation for a control checks the property that is associated with that control. When an end user clicks a check box, for example, the associated property is potentially changed to one of two new values. Validation offers a method for checking whether the new value is appropriate.

Various types of controls trigger validation at different events:

Triggers for Different Types of Validation

Types of Controls

Event that Triggers Validation

Text box,
password box

Validation occurs when the entry in the control changes.

Button,
command link,
check box,
radio button,
image button

Validation occurs when the end user clicks the control.

Combo box,
list box,
checked list box,
feature selection tree

Validation occurs when the selection for the control changes.

You can use the subsettings under the Text Style setting to specify different text styles for the control to give end users a visual indication when the control is in various states (default, valid, or invalid).

You can also use the subsettings in the Events area to trigger an action when the end user clicks or uses the control. If you have actions and validation configured for a control, the validation runs before the actions. For more information about actions, see Configuring an Action for an Element in the Wizard Interface.

To configure validation for a control:

1. In the View List under User Interface, click Wizard Interface.
2. In the Wizard Interface explorer, select the wizard page or secondary window that you want to modify.
3. In the wizard editor, select the control that requires validation.
4. In the Validate setting, click the Validation button and then point to the type of validation that you want to occur.

One of the types of validation lets you call a function in a DLL file that you have created. If your project includes any DLL files in the Support Files view, InstallShield makes them available in this list, and lets you overwrite the validation function name with the function in the DLL that you want to call.

The following table describes the types of validation that are available. Note that some types of validation are applicable to only certain types of controls. For example, the value length validation is applicable only to the text box and password box controls.

Types of Validation for Wizard Interface Controls

Type of Validation

Description

Existing File

This type of validation checks whether the value of the property that is associated with this control contains the fully qualified path and name of a file that is present. The end user typically sets the value of the property when entering the path and file name in this control.

Existing Folder

This type of validation checks whether the value of the property that is associated with this control contains the fully qualified path and name of a folder that is present. The end user typically sets the value of the property when entering the path and folder name in this control.

New File in Existing Folder

This type of validation checks whether the value of the property that is associated with this control contains the fully qualified path and name of a file that is not present. The end user typically sets the value of the property when entering the path and file name in this control.

Note that the path for the file must exist for this type of validation.

Value Length

This type of validation checks whether the value of the property that is associated with this control contains a certain number of characters. The end user typically sets the value of the property when entering text in this control.

To configure this type of validation, specify the minimum and maximum values in the subsettings under this setting.

Value Mask

This type of validation checks whether the value of the property that is associated with this control matches a particular format. The end user typically sets the value of the property when entering information such as a serial number in this control.

To configure this type of validation, specify the required format in the Pattern setting under this setting. Enter any of the following characters in place of a digit:

# % @

Enter any of the following characters in place of a character:

& ^ ? ’

Any other characters that you enter must match exactly.

Browse for DLL Action

This type of validation calls a function in a DLL file that you have created and added to your project through the Support Files view. For example, you can use a DLL file to check the validity of the property’s value—that is, the input that the end user enters for the control.

See Also