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]: User Contributions[Next]: CACLS.EXE - How to use Well Known SID
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->User Contributions->AutoRun SETUP.EXE from CD-ROM

AutoRun SETUP.EXE from CD-ROM

This information and/or code in this section was provided by Julian Onions (thank you).

Don't know if anyones interested, but I wrote a couple of really small
macros (which will probably turn Dennis's stomach on first sight - but
I'm learning!) that  help you to automate the process of making
autorun'able CD's.

They basically copy some needed files into the MSI directory, build a
small autorun.inf and patch the setup.exe to invoke the right MSI file
(using the SDK setup.exe and msistuff tools). If anyone is interested I
can post them, but they'll probably need some extensions for maximum
portability.

The Macros

; autorun.mmh
; Rules to make an installable setup
; uses
; InstMsiW.exe  InstMsiA.exe - both downloadable from microsoft site
; setup.exe - compile from platform SDK
; msistuff.exe - same place.
;

; Copy a file into the MSI build directory
#(
   #define InstallSetupFile
   #DefineRexx ''
;       call Info "Copy {$#1} <$MAKEMSI_OUT_MSI_DIR>{$#1}";
        call FileCopy("{$#1}", "<$MAKEMSI_OUT_MSI_DIR>{$#1}", "");
   #DefineRexx
#)

;;; Patch the setup program with msistuff
;;; Requires
;;;   Setup - the setup exe to patch
;;; Optional
;;;   MsiName - the msi destination name (defaults to current build)
;;;   ProductName - what it will call it, defaults to current name
;;;   Version - installer version required will default to a defined version but this is often too low for msistuff
#(
  #define PatchSetup
  #DefineRexx ''
    call Info("Patch Setup for MSI {$MsiName="<$MSI_MSIBASENAME>"} version {$VERSION="<$COMPANY_SUMMARY_SCHEMA>"} name {$ProductName='<$ProdInfo.ProductName>'}");
    call AddressCmd('MsiStuff {$Setup} /d "{$MsiName="<$MSI_MSIBASENAME>"}" /n "{$ProductName='<$ProdInfo.ProductName>'}" /v {$VERSION="<$COMPANY_SUMMARY_SCHEMA>"} /a InstmsiA.exe /w InstmsiW.exe') ;
  #DefineRexx
#)

;;; Autorun support
;;;
;;; Writes to autorun.inf
;;; Required parameter
;;;  Setup - name of a setup.exe program to run and be patched
;;;  Icon - the icon for the disk - can be a .ico file, or a binary as in "setup.exe,1"
;;; Assumes you have availabe in the build directory
;;; InstMsiW.exe & InstMsiA.exe (MSI installer bootstrap for windows - free download)
;;;

#(
  #define AutoRun
  ; write ico and setup into autorun
  #DefineRexx ''
    @@FileAutoRun = "<$MAKEMSI_OUT_MSI_DIR>autorun.inf";
    call FileDelete @@FileAutoRun;
    call FileLineOut @@FileAutoRun, "[autorun]";
    call FileLineOut @@FileAutoRun, "Open={$setup}";
    call FileLineOut @@FileAutoRun, "Icon={$Icon}";
    call FileClose @@FileAutoRun;
  #DefineRexx
  <$InstallSetupFile "{$Icon}">
  <$InstallSetupFile "{$setup}">
  <$PatchSetup Setup="<$MAKEMSI_OUT_MSI_DIR>{$setup}" Version="200">
  <$InstallSetupFile "InstMsiW.exe">
  <$InstallSetupFile "InstMsiA.exe">
#)

Example of Macro Use

<$AutoRun Icon="LP.ico" setup="Setup.exe">


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]: User Contributions[Next]: CACLS.EXE - How to use Well Known SID


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.