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]: VbsCaSetup[Next]: VBSCRIPT
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->WrapInstall

The "WrapInstall" Command

The "repackaging" section of this documentation provides a fair range of details, links and options for creating an MSI from an "EXE" based installer (its an "exe to msi" converter if you like). This command provides a simple mechanism to wrap existing installers (one of these approaches).

This command can wrap a single EXE program or a whole CD's tree worth of files (setup.exe plus its associated files and directories). While what it is doing is simple the command itself and the available options are reasonably complex, also if you have a really difficult package you may need to perform the correct actions yourself rather than use this command.

Consider the need to use the "RunProcess.exe" command with a timeout, I recommend that you do this for any InstallShield setup.exe programs (cr.pware), see its "/k" parameter.

Parameters

This command takes these parameters:

Options

Please see the "options for commands" section of the manual.

#define? WRAPINST_SEQ_INSTALL            StartServices-RegisterUser
#define? WRAPINST_SEQ_UNINSTALL          InstallInitialize-StopServices
#define? WRAPINST_CONDITION_INSTALL      <$CONDITION_INSTALL_ONLY>        ;;You could add repair etc.
#define? WRAPINST_CONDITION_UNINSTALL    <$CONDITION_UNINSTALL_ONLY>      ;;Make this "" if you don't want to ever uninstall (rare?)
#define? WRAPINST_BASETYPE_INSTALL       Deferred                         ;;Base CA attributes (install). You may need to add "SYSTEM".
#define? WRAPINST_BASETYPE_UNINSTALL     Deferred                         ;;Base CA attributes (uninstall). You may need to add "SYSTEM".
#define? WRAPINST_HIDE_WRAPPED_PRODUCT   Y                                ;;Don't show in ARP as wrapping product will uninstall
#define? WRAPINST_(UN)INSTALL_VALIDATION Y
#define? WRAPINST_INSTALL_VALIDATION         <$WRAPINST_(UN)INSTALL_VALIDATION>
#define? WRAPINST_UNINSTALL_VALIDATION       <$WRAPINST_(UN)INSTALL_VALIDATION>
#define? WRAPINST_UNINSTALL_VALIDATION_WAIT  0                               ;;Some uninstalls are ASYNC with task returning before complete!  If non-blank and non-zero then how many seconds do we wish to allow for the uninstall task to complete?
#define? WRAPINST_CDIMAGE_COPYATTRIBUTES                                     ;;See the "CopyAttributes" on the file command

EXAMPLE

You should read the "InstallShield Version 7.00" section of the doco, then look at this example:

;----------------------------------------------------------------------------
;--- "SETUP-I.ISS" points here! ---------------------------------------------
;----------------------------------------------------------------------------
<$DirectoryTree Key="PRODUCTDIR" Dir="c:\Program Files\WrappedProducGoesHere">


;----------------------------------------------------------------------------
;--- Install the CD-IMAGE here ----------------------------------------------
;----------------------------------------------------------------------------
<$DirectoryTree Key="INSTALLDIR" Dir="[PRODUCTDIR]\MsiSource (wrapper)" CHANGE="\">


;----------------------------------------------------------------------------
;--- Set up the response file created with "setup.exe /r" (created in "c:\winnt" dir) ---
;----------------------------------------------------------------------------
#(
    #define AddResponseFile
    <$File Source="{$ISS}" Destination="[INSTALLDIR]\{$ISS}" Comment=^Response file for {$FOR} (renamed "setup.iss" file). Generated by manual {$FOR} of product using "setup.exe /r".^>
    <$SourceFile FileName="{$ISS}" HTML="Y">
#)
<$AddResponseFile ISS="setup-I.iss"  FOR="installation">
<$AddResponseFile ISS="setup-UI.iss" FOR="uninstallation">


;----------------------------------------------------------------------------
;--- Install InstallShield based Installer ----------------------------------
;----------------------------------------------------------------------------
#(
    <$WrapInstall
        ;--- Where is the CD Image? -----------------------------------------
        CdImage=".\CD-IMAGE"

        ;--- INSTALL --------------------------------------------------------
         EXE="[INSTALLDIR]setup.exe"
        Args='/s /f1"[INSTALLDIR]setup-I.iss" /f2"[INSTALLDIR]setup-I-<$ProductVersion>.log"'

        ;--- UNINSTALL ------------------------------------------------------
         UninstallExe="[INSTALLDIR]setup.exe"
        UninstallArgs='/s /f1"[INSTALLDIR]setup-UI.iss" /f2"[INSTALLDIR]setup-UI-<$ProductVersion>.log"'

        ;--- VALIDATION -----------------------------------------------------
        UninstallKey="{149511F11-4375-4557-5541-8F9217A15480}"
    >
#)


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]: VbsCaSetup[Next]: VBSCRIPT


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.