MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: MsiExtraFiles[Next]: Path
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->MsiValFilter

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:

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 ">


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: MsiExtraFiles[Next]: Path


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.