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]: TryMeShortcuts.MM[Next]: TryMeWithUserDialog.MM
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->TryMeWindowsHotFix.MM

TryMeWindowsHotFix.MM

This example demonstrates the "Windows Hot Fixes" framework and is one of the MAKEMSI samples which build a new MSI/MSM.

To build the MSI you need download the "KB872942" hotfix EXE into the same directory as the ".mm" script.

This sample uses its own ".ver" file unlike many of the other "TryMe" samples and it is a common one you'd use for all similar packages), the full script:

;----------------------------------------------------------------------------
;    MODULE NAME:   TryMeWindowsHotFix.MM
;
;        $Author:   USER "Dennis"  $
;      $Revision:   1.3  $
;          $Date:   21 Dec 2006 17:54:02  $
;       $Logfile:   C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/TryMeWindowsHotFix.mm.pvcs  $
;
;  For this example I decided to create a common ".MMH" and ".VER" file so
;  in "real life", there would only be the ".mm" and ".exe" in the source
;  directory and each hotfix (product) would just have a different guid
;  assigned in the script (note it would be possible to also have MAKEMSI
; automatically do a once off assignment).
;----------------------------------------------------------------------------

;--- For the purposes of this example I put "common files" elsewhere, normally you'd set this up globally (not in script) ---
#evaluate ^^ ^call IncludePath 'COMMON FILES'^          ;;Example only, this is not the correct place for this code...


;--- Specify upgrade code and generate HOTFIX package -----------------------
#define  HotFix4WinXpSp2_UpgradeCode    {58418121-FB16-4C99-AB64-410343E20C2F}
#include "HotFix4WinXpSp2.MMH"
;#include "HOTFIX.MMH"                  ;;We won't call directly but via WINXP SP2 config file...

Common Header: "HotFix4WinXpSp2.mmh"

This personal MAKEMSI configuration file would normally be stored once somewhere on your computer and certainly not be in the same directory as the script using it (or duplicated for each project)...

;----------------------------------------------------------------------------
;    MODULE NAME:   HotFix4WinXpSp2.mmh
;
;        $Author:   USER "Dennis"  $
;      $Revision:   1.2  $
;          $Date:   07 Feb 2007 18:24:34  $
;       $Logfile:   C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/HotFix4WinXpSp2.mmh.pvcs  $
;
; Sample hot fix configuration which could be reused by many WINXP hotfixes.
;
; This was installed for use by the "TryMeWindowsHotFix.MM" hotfix example.
;----------------------------------------------------------------------------


;----------------------------------------------------------------------------
;--- Define Version Number of this header -----------------------------------
;----------------------------------------------------------------------------
#define VERSION_HotFix4WinXpSp2 06.355


;----------------------------------------------------------------------------
;--- Work out where our header (and so other related files) is located ------
;----------------------------------------------------------------------------
#evaluate 'HotFix4WinXpSp2_DIR' ^'<?InputComponent:L>'^


;----------------------------------------------------------------------------
;--- Want a bit more structure around the installation directory ------------
;----------------------------------------------------------------------------
#define? HOTFIX_ROOT_INSTALL_DIR   C:\Program Files\MmHotFixes\WinXP\SP2+


;----------------------------------------------------------------------------
;--- DO we have "QfeCheck.exe" in the common directory? ---------------------
;----------------------------------------------------------------------------
#define? HOTFIX_QFECHECK.EXE_BASENAME   QfeCheck.exe  ;;defines the name of the EXE (no path)
#if FileQueryExists('<$HotFix4WinXpSp2_DIR><$HOTFIX_QFECHECK.EXE_BASENAME>') <> ''
    ;--- The file is in the common location ---------------------------------
    #define? HOTFIX_QFECHECK.EXE <$HotFix4WinXpSp2_DIR><$HOTFIX_QFECHECK.EXE_BASENAME>
#endif


;----------------------------------------------------------------------------
;--- Use common VER file unless user chose their own ------------------------
;----------------------------------------------------------------------------
#ifndef VER_FILENAME.VER
    ;--- We will have a single version file for all WINXP SP2 hotfixes ------
    #ifndef HotFix4WinXpSp2_UpgradeCode
            #error ^We have one version file shared across all WinXP SP2 hotfixes, you must tell me the UpgradeCode GUID via the "HotFix4WinXpSp2_UpgradeCode" definition.^
    #endif
    #evaluate 'VER_FILENAME.VER' ^'<$HotFix4WinXpSp2_DIR>HotFix4WinXpSp2.VER'^  ;;All team MSIs use same ver file (its in same dir as "HotFix4WinXpSp2.mmh")

    ;--- Want to automicallically build a "reasonable" version number -------
    #ifndef HotFix4WinXpSp2_ProductVersion
        ;--- User hasn't specified a preferred number so build one... -------
        #evaluate "HotFix4WinXpSp2_ProductVersion" ^FormatTime("%y.%m.%d.%H%M", TimeStamp())^
    #endif
#endif


;----------------------------------------------------------------------------
;--- Hot fixes including this header only install on WINXP SP2+ -------------
;----------------------------------------------------------------------------
#define HOTFIX_APPLY_CONDITION     <$CONDITION_IS_WINXP> and (ServicePackLevel >= 2)
#define HOTFIX_APPLY_ABORTED_TEXT  This hotfix only installs on WINXP with at least service pack 2 installed.


;----------------------------------------------------------------------------
;--- Override other options -------------------------------------------------
;----------------------------------------------------------------------------
;#define? HOTFIX_USE_THIS_MAKEMSI_SUPPORT  DENNIS.MMH    ;;Use my MAKEMSI support! (commented out to prevent info zip problems for you...)


;----------------------------------------------------------------------------
;--- Load the hotfix framework and MAKEMSI ----------------------------------
;----------------------------------------------------------------------------
#include "HOTFIX.MMH"


;----------------------------------------------------------------------------
;--- Record details about this header ---------------------------------------
;----------------------------------------------------------------------------
<$SourceFile VERSION=^<$VERSION_HotFix4WinXpSp2>^ HTML="Y">

Common Version File: HotFix4WinXpSp2.ver

This is a common version file used by default by all projects that make use of the "HotFix4WinXpSp2.mmh" personal MAKEMSI configuration file shown above. It should be located in the same directory as the common header!

;----------------------------------------------------------------------------
;
;    MODULE NAME:   HotFix4WinXpSp2.VER
;
;        $Author:   USER "Dennis"  $
;      $Revision:   1.0  $
;          $Date:   21 Dec 2006 17:53:54  $
;       $Logfile:   C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/HotFix4WinXpSp2.VER.pvcs  $
;
;    DESCRIPTION:   Used by all projects (by default) that make use of
;                    the "HotFix4WinXpSp2.mmh" header...
;
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; ProductName = MicrosoftWinXpSp2<??RxHotFixId>HotFix
; DESCRIPTION = Installs hotfix <??RxHotFixId> via the Microsoft supplied
;             = "<??RxHotFixExe>" installer.
;             = The hot fixes applies to WinXP Service pack 2.
;             = Installation and uninstall success is validated.
; Installed   = WINDOWS_ALL
; Guid.UpgradeCode = <$HotFix4WinXpSp2_UpgradeCode>
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



;############################################################################
VERSION : <$HotFix4WinXpSp2_ProductVersion>
DATE    : <?CompileTime>
CHANGES : Not maintaining a change history...


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]: TryMeShortcuts.MM[Next]: TryMeWithUserDialog.MM


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.