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]: TryMeLoadDirTreeMaintainingAttributes.MM[Next]: TryMeCreateMergeModule.VER
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->MAKEMSI Installs...->Samples Installed by MAKEMSI->Samples - Build New MSI/MSM->TryMeCreateMergeModule.MM

TryMeCreateMergeModule.MM

This is one of the MAKEMSI samples which build a new MSI/MSM.

The version file differs from that used for MSIs and can be found at "TryMeCreateMergeModule.VER". You can test the generated merge module with the "TryMeUseMergeModule.mm" sample.

;----------------------------------------------------------------------------
;    MODULE NAME:   TryMeCreateMergeModule.MM
;
;        $Author:   USER "Dennis"  $
;      $Revision:   1.0  $
;          $Date:   29 Nov 2006 18:31:54  $
;       $Logfile:   C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/TryMeCreateMergeModule.mm.pvcs  $
;
; DESCRIPTION
; ~~~~~~~~~~~
; A same/test merge module you can use the created MSI via the
; sample "TryMeUseMergeModule.MM".
;
; Note that almost every merge module I have ever seen has incorrectly
; defined "SystemFolder", "ProgramFilesFolder" etc, I have created the
; "MsmSystemDirectory" macro to make the correct definition of these
; childs play...
;
; You would probably wish to create all components yourself as the greater
; control you have is probably required.
;
; I don't create many merge modules (yet), if something is an issue then
; let me know and I'll come up with a way of making it easier.
;----------------------------------------------------------------------------


;----------------------------------------------------------------------------
;--- Load MAKEMSI (via wrapper) ---------------------------------------------
;----------------------------------------------------------------------------
#include "MakeMsm.MMH"              ;;Load the merge module support


;----------------------------------------------------------------------------
;--- Correctly define "ProgramFilesFolder" (call it "PFF") ------------------
;----------------------------------------------------------------------------
<$MsmSystemDirectory "ProgramFilesFolder" KEYMAC="PFF">


;----------------------------------------------------------------------------
;--- Define installation directory (under "ProgramFilesFolder") -------------
;----------------------------------------------------------------------------
#define  INSTALLDIR  MyDir<$MsmSuffix>
#define+ AnyDir      <$INSTALLDIR>          ;;If MAKEMSI creates components for me, I don't want it to use "TARGETDIR"!
<$Directory Key="<$INSTALLDIR>" Parent="<$PFF>" Dir="MmTest">


;----------------------------------------------------------------------------
;--- Add a file to a component we create (fixed GUID) -----------------------
;----------------------------------------------------------------------------
#define AnyFileWillDo   <?InputFile>
<$Component "MyComp<$MsmSuffix>" Directory_="<$INSTALLDIR>" ComponentId=^?MyComp^ Attributes=^SharedDllRefCount Permanent^>
    <$File Source="<$AnyFileWillDo>" 8.3="NoClash.1">
<$/Component>


;----------------------------------------------------------------------------
;--- Add a file (let it create a component - GUID not fixed!) ---------------
;----------------------------------------------------------------------------
#define+ DEFAULT_COMPONENT_ATTRIBUTES SharedDllRefCount Permanent  ;;Another way to set attributes.
<$File Source="<$AnyFileWillDo>" Destination="[<$INSTALLDIR>]\ViaFileCreatedComponent.fcc">

;----------------------------------------------------------------------------
;--- Add a registry entry (let it create a component - GUID not fixed!) -----
;----------------------------------------------------------------------------
<$Registry HKEY="CURRENT_USER" Key="Software\DENNIS_ViaMm" Name='From <?InputFile>'  Value="Hi ya">


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]: TryMeLoadDirTreeMaintainingAttributes.MM[Next]: TryMeCreateMergeModule.VER


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.