User Guide
374
Package Validation
• Consists of a series of conditions and actions, see Adding a Validation Rule Set
on page 376.
5. When you finish, click OK.
The customizations remain in effect until you change them.
Also see:
Customizing Validation Modules
Predefined Validation Modules
About Rules That Call a Custom Action
" Enterprise Edition only.
You can add rules that call a custom action to a new or existing validation module
(.CUB). The custom action, which must be in the form of a .DLL, .EXE, or VBScript
(.VBS), performs specific checks on a package. For details, see Adding a Rule That Calls
a Custom Action on page 374.
Note:
You cannot add rules to predefined validation modules.
Example: Suppose you want to check packages for hard-coded references to C:\ or D:\
and replace those references with the directory property INSTALLDIR. To do this, write a
VBScript to find and replace the references and then display a message. In Package
Validation, you specify a new or existing .CUB file and add a rule that calls the VBScript.
When you run Package Validation with the new rule enabled, the VBScript performs the
find and replace operations.
When a validation test finds an error based on a custom action rule, the Correct button
on the View / Correct dialog is not enabled; the error is fixed based on functions in the
custom action. Errors found by a custom action rule are displayed on the View / Correct
dialog only if the custom action contains a message string. For information on
formatting message strings, see ICE Message Guidelines in the Windows Installer SDK
Help.
For information on creating a custom action to perform validation checks, see Internal
Consistency Evaluators - ICEs and Building An ICE in the Windows Installer SDK Help.
Also see:
Customizing Validation Modules
About Validation Rule Sets
Adding a Validation Rule Set
Adding a Rule That Calls a Custom Action
" Enterprise Edition only.
Note
When customizing a predefined validation module, customize a copy of the module to retain
the original file.
1. Write a custom action (.DLL, .EXE, or VBScript) to perform validation checks.