\Building or Updating MSIsValidationsRow Validation
As well as validating a completed MSI
all data manipulations done via the "Row" command
can be validated (see its "@METHOD" and "@VALIDATE" parameters).
The "_Validation" table information is used for this.
The validation can be turned off if required using the
"@Validation" parameter but I suggest that you leave it on as it takes
insignificant time to perform.
The parameter is mainly supplied as an escape method if you find some
situation where because of row ordering or other issues you can't
remove the "problem".
It is also possible to filter out specific validation errors if required.
When the row update or insertion fails the failing columns names are
displayed along with a reason for each failure.
Some good reasons to leave row validation on:
- When a record fails validation the failing record's contents
is also dumped.
- You don't have to wait until the whole MSI is built before getting
any indications of problems.
You also know exactly where the problem is.
- If the problem would otherwise cause the MSI build to fail then
the problem can be much more difficult to diagnose.
|Types of Row Validation Errors Detected|
Not all of the following errors will be picked up by
"Row" commands depending on the
value of the "@method" parameter.
- An argument was invalid.
- The buffer was too small to receive data.
- The function failed.
- The new record duplicates primary keys of the existing record in a table.
- There are no NULL values allowed, or the column is about to be deleted but is referenced by another row.
- The corresponding record in a foreign table was not found.
- The data is greater than the maximum value allowed.
- The data is less than the minimum value allowed.
- The data is not a member of the values permitted in the set (see _Validation table).
- An invalid version string was supplied.
- Mixed case is not allowed (must be all upper or lower).
- An invalid GUID was supplied. Note that any letters must be UPPER case.
- An invalid wildcard file name was supplied, or the use of wildcards was invalid. The name is assumed to be in '8.3' format unless both both 8.3 and long versions supplied (example 'ABCDEF~1.TXT|abcdefgh ij.txt').
- An invalid identifier was supplied. An identifier must begin with either a letter or an underscore which is followed by zero or more letters, digits, underscores ('_'), or periods ('.')
- Invalid language IDs were supplied.
- An invalid file name was supplied. The name is assumed to be in '8.3' format unless both both 8.3 and long versions supplied (example 'ABCDEF~1.TXT|abcdefgh ij.txt').
- An invalid path was supplied.
- An invalid conditional statement was supplied.
- An invalid formatted string was supplied. You probably need to "escape" characters such as curley or square brackets (encode "[" as "[\" etc).
- An invalid template string was supplied.
- An invalid string was supplied in the DefaultDir column of the Directory table.
- An invalid registry path string was supplied.
- An invalid string was supplied in the CustomSource column of the CustomAction table.
- An invalid property string was supplied.
- This column is not mentioned in the _Validation table. Either add the validation data or use the "@validate" parameter on the "row" command (or alter its default).
- The category column of the _Validation table for the column is invalid.
- The table in the Keytable column of the _Validation table was not found or loaded.
- The value in the MaxValue column of the _Validation table is less than the value in the MinValue column.
- An invalid cabinet name was supplied.
- An invalid shortcut target name was supplied.
- The string is too long for the length specified by the column definition.
- An invalid localization attribute was supplied (Primary keys cannot be localized).
Note that you can override the text with your own alternative by
creating macros such as "@VALIDATE_TEXT_FOR_MISSINGDATA".