MAKEMSI Merge Modules |
This section describes a simpler alternative to the "traditional" merge module (".MSM") which is suitable for use if all uses of the module are going to be via MAKEMSI scripts.
This method basically uses the PPWIZARD "#include" command to include a common header which contains normal MAKEMSI and commands to include common "logic" and MSI components.
As per merge modules of any type it is wise to be careful about any row keys used to ensure that it is unlikely/impossible to clash with keys used by other merge modules or MSIs.
Some advantages of this method over "traditional" merge modules are:
Some disadvantages of this method over "traditional" merge modules are:
Example - include "MERGE MODULE" |
#include "SomeDll.mmh"
Example "MERGE MODULE" |
I used the GUID Generation tool to generate the fixed GUID used for the component in the following example.
;--- Initialization --------------------------------------------------------- #NextId #NextId LOCK "SomeDll.MMH" ;--- Globals ---------------------------------------------------------------- #define @@Kp Mm.SomeDll. ;;KeyPrefix (merge module namespace) #define @@FileSourceDir <??*MM>\SomeDll ;;The "MM" environment variable will point to source location root #define @@CommentSuffix Included by "<?InputComponent>". ;--- Create component (fixed GUID) ------------------------------------------ <$DirectoryTree Key="<$@@Kp>INSTALLDIR" DIR="[CommonFilesFolder]\SomeDll.mmh"> <$Component "<$@@Kp>INSTALLDIR" Directory_="<$@@Kp>INSTALLDIR" ComponentId="{27EE19E7-1355-4632-94B4-FCD1859DE6F4}"> ;--- Add DLL as Keypath and register ------------------------------------- #( <$File RowKey="<$@@Kp>Dll" SOURCE="<$@@FileSourceDir>SomeDll.dll" Comment=^A handy DLL which we will self register. <$@@CommentSuffix>^ KeyPath="Y" > #) <$SelfRegister "<$@@Kp>Dll"> ;--- Add doco also (no shortcut) ----------------------------------------- #( <$File RowKey="<$@@Kp>Chm" SOURCE="<$@@FileSourceDir>SomeDll.chm" Comment=^Documentation for "SomeDll.dll". <$@@CommentSuffix>^> #) <$/Component> ;--- Remember header details ------------------------------------------------ <$StampSourceDetailsIntoProperty Version="<?InputComponentTime>"> ;--- Termination ------------------------------------------------------------ #NextId UNLOCK "SomeDll.MMH"