\User ContributionsAutoRun 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.
; 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">
#)
<$AutoRun Icon="LP.ico" setup="Setup.exe">