The "MsiValFilter" Command |
This command is used to to add to the MSI Validation filtering.
Note that if you upgrade "MSIVAL2" or its validation databases you may find some of the messages may have altered requiring you to update your filters.
Please read the "Don't ignore or completely turn off Validation Messages" section.
The macro takes these parameters:
EXAMPLES |
The following code creates a component with a "local_machine" keypath, this will generate 2 warnings however as we ensure that the MSI is always installed per-machine we will override the expected messages:
;--- Create component with HKLM (not HKCU) Keypath -------------------------- <$Component "LogShortcuts" Create="Y" Directory_="LOGDIR" LM="Y"> ;--- Filter out validation messages cause by the above HKLM keypath ------ <$MsiValFilter "Component LogShortcuts has non-advertised shortcuts. It's KeyPath registry key should fall under HKCU."> <$MsiValFilter "Component 'LogShortcuts' has both per-user and per-machine data with a per-machine KeyPath."> ;--- Create the shortcuts ------------------------------------------------ <$DirectoryTree Key="LOGMENUDIR" Dir="[ProgramMenuFolder]\Tool Logs" MAKE="Y" REMOVE="Y"> <$Icon KEY="ViewLog.ico.exe" ".\ViewLog.ico"> #( ;--- Create macro for log file shortcuts (all look the same) --------- #define ToolLogSc <$Shortcut Dir="LOGMENUDIR" TARGET="[SystemFolder]notepad.exe" ;;Non-advertised Arguments=^"[LOGDIR]{$#1}"^ Title="View {$#1}" Description="View the log file ({$Desc})." Icon="ViewLog.ico.exe" WorkDir="INSTALLDIR" > #) <$ToolLogSc "FirstLog.log" Desc=^Hold information of type 1^> <$ToolLogSc "SecondLog.log" Desc=^Hold information of type 2^> <$ToolLogSc "ThirdLog.log" Desc=^More stuff^> <$/Component>
The following shows how a regular expression could be used to "turn off" the validation for all components:
<$MsiValFilter "Component .+ has non-advertised shortcuts\. It's KeyPath registry key should fall under HKCU\." RE="Y"> <$MsiValFilter "Component '.+' has both per-user and per-machine data with a per-machine KeyPath\." RE="Y">
In the above:
If the regular expression is not working then you have probably forgotten to escape something, for example a bracket, that is you used "(" and not "\(".
Not that I recommend this but the last example shows how to ignore all warning messages (in fact any message containing that text):
<$MsiValFilter " WARNING ">