Share via


SerialNumberTemplate Property

Specifies a template used to validate serial number entry on a Customer Information dialog box during installation on a target computer.

The SerialNumberTemplate property determines how the text boxes will appear in the dialog box and also whether the serial number is validated only for format, or validated according to a Windows Installer algorithm.

For example, setting the SerialNumberTemplate property to "<### - %%%%>" creates two text boxes separated by a dash surrounded by spaces. Validation for the first box (###) simply verifies that the user has entered three digits. The second box (%%%%) is validated by an algorithm that adds the digits together and divides the sum by 7. If the remainder is 0, validation succeeds; otherwise, it fails.

Editable characters appear in the Customer Information dialog box as placeholders within text boxes; any other characters appear as labels between the text boxes.

Note

A separate text box will be created each time the editable character is changed, for example, entering "#?%" creates three text boxes, each accepting one character.

Settings

Valid editable characters for the SerialNumberTemplate property are:

Character

Meaning

#

Requires a digit that will not be included in the validation algorithm.

%

Requires a digit that will be included in the validation algorithm.

?

Requires an alphanumeric character that will not be included in the validation algorithm.

^

Requires an uppercase or lowercase character. Numeric digits are not valid here.

<

Any characters to the left of this character will not be visible in the dialog box.

>

Any characters to the right of this character will not be visible in the dialog box. Required as a terminator if the < character is used.

Any other character is treated as a literal constant.

Remarks

If the ShowSerialNumber property is set to true, the serial number will be validated against the template specified in the SerialNumberTemplate property before the user is allowed to move to the next installation step. If the ShowSerialNumber property is set to false, the SerialNumberTemplate property has no effect.

See Also

Reference

Properties for the User Interface Editor

ShowSerialNumber Property

Other Resources

PIDTemplate Property (Windows)

ValidateProductID Action (Windows)

MaskedEdit Control (Windows)