December 15, 2006

Setup.exe and Update.exe Command-Line Parameters

InstallShield DevStudio

Like your compiled .msi file, Setup.exe can accept a number of command line parameters. Update.exe (available only for MSI projects) accepts nearly all of the same command line parameters. Using these parameters, end users can specify such data as the language the setup should run in and whether to launch Setup.exe silently. End users can also pass parameters through Setup.exe to the included .msi file.

Command-line options that require a parameter must be specified with no space between the option and its paramater. For example, Setup.exe /v"ALLUSERS=2" is valid, while Setup.exe /v "ALLUSERS=2" is not. Quotation marks around an option's parameter are required only if the parameter contains spaces.

Several of the command-line arguments apply only to InstallScript MSI projects or InstallScript projects.

Setup.exe accepts the following command line parameters:

Special Installation Modes (Windows Installer based projects only)

Silent Installations

SMS Data

Download and Cache Locations (Windows Installer based projects only)

You must specify the full URL with these parameters in order for them to apply correctly.

Passing Data to the Installation

Debugging

Miscellaneous

Special Installation Modes (Windows Installer based projects only)

/a : Administrative installation

The /a parameter does not work with Update.exe. Update.exe launches a patch which accesses and modifies an existing cached MSI on the system, and an administrative installation does not cache the MSI.

The /a switch causes Setup.exe to perform an administrative installation. An administrative installation copies (and uncompresses) your data files to a directory specified by the user, but does not create shortcuts, register COM servers, or create an uninstallation log.

/j : Advertise mode

The /j switch causes Setup.exe to perform an advertised installation. An advertised installation creates shortcuts, registers COM servers, and registers file types, but does not install your product's files until the user invokes one of these “entry points”.

/x : Uninstall mode

The /x switch causes Setup.exe to uninstall a previously installed product.

/uninst : Uninstall product (InstallScript and InstallScript MSI projects only)

The /uninst switch causes Setup.exe to uninstall a previously installed product, without reading the script.

Silent Installations

/p : Specify password

If you selected the “Password Protect Setup.exe” option in the Release Wizard for your release, the user must specify the password with the /p argument at run time. A typical command is Setup.exe /s /p"password".

/r : Record mode (InstallScript and InstallScript MSI projects only)

In order to run an InstallScript MSI or InstallScript project installation program in silent mode, you must first run Setup.exe with the /r switch to generate a response file, which stores information about the data entered and options selected by the user at run time.

Running an InstallScript MSI or InstallScript installation program with the command Setup.exe /r displays all the run-time dialog boxes, and stores the data in a file called Setup.iss, created inside the system's Windows folder. To specify an alternative response file name and location, use the /f1 argument, described below.

Basic MSI projects do not create or use a response file for silent installations.

/s : Silent mode

For an InstallScript MSI or InstallScript project, the command Setup.exe /s runs the installation in silent mode, by default based on the responses contained in a response file called Setup.iss in the same directory (response files are created by running Setup.exe with the /r option). To specify an alternative file name or location of the response file, use the /f1 option, described below.

The command Setup.exe /s also suppresses the Setup.exe initialization window for a Basic MSI installation program, but does not read a response file. To run a Basic MSI product silently, run the command line Setup.exe /s /v/qn. (To specify the values of public properties for a silent Basic MSI installation, you can use a command such as Setup.exe /s /v"/qn INSTALLDIR=D:\Destination".)

/f1 : Specify alternative response file name (InstallScript and InstallScript MSI projects only)

Using the /f1 argument allows you to specify where the response file is (or where it should be created) and what its name is, as in Setup.exe /s /f1"C:\Temp\Setup.iss". The /f1 switch is available both when creating a response file (with the /r option) and when using a response file (with the /s option).

/f2 : Specify alternative log file name (InstallScript and InstallScript MSI projects only)

When running an InstallScript MSI or InstallScript installation in silent mode (using the /s argument), the log file Setup.log is by default created in the same directory and with the same name (except for the extension) as the response file. The /f2 argument allows you to specify an alternative log file location and file name, as in Setup.exe /s /f2"C:\Setup.log".

SMS Data

/m : Generate MIF file (InstallScript projects only)

The /m switch causes Setup.exe to generate an SMS Management Information Format (MIF) file. A typical command is Setup.exe /m"SampleApp". (Including the “.mif” file extension is not necessary.)

/m1 : Specify serial number in MIF file (InstallScript projects only)

Using the /m1 parameter (along with /m) enables you to specify a serial number to be written to the MIF file. A typical command is Setup.exe /m"SampleApp" /m1"1234-5678".

/m2 : Specify locale string in MIF file (InstallScript projects only)

Using the /m2 parameter (along with /m) enables you to specify a locale string to be written to the MIF file. A typical command is Setup.exe /m"SampleApp" /m2"ENU".

Download and Cache Locations (Windows Installer based projects only)

/ua : Specify URL for InstMsiA.exe
/uw : Specify URL for InstMsiW.exe

In the Release Wizard, you can specify download locations for the Windows Installer installers InstMsiA.exe and InstMsiW.exe. A user can specify an alternative URL at run time using the /ua/uw switches, as in Setup.exe /uw"http://www.otherlocation.com/engines". The file name is not necessary. and

/us : Specify URL to ISScript.msi

In the Release Wizard, you can specify a download location for the InstallScript engine installer ISScript.msi. A user can specify an alternative URL using the /us switch, as in Setup.exe /us"http://www.otherlocation.com/isengine". The file name is not necessary.

/um : Specify URL to .msi package

In the Release Wizard, for a Downloader build, you can specify a download location for your MSI database. A user can specify an alternative URL using the /um switch, as in Setup.exe /um"http://www.otherlocation.com/packages/product.msi".

/b : Cache installation locally

In the Release Wizard, for a Downloader build, you can specify whether to cache the contents of a compressed package on the local system. With the /b argument, the user can specify the directory in which to cache the installation files, as in Setup.exe /b"C:\CacheDirectory".

Passing Data to the Installation

/v : pass arguments to Msiexec (Windows Installer-based projects only)

The /v argument is used to pass command line switches and values of public properties through to Msiexec.exe.

/z : Pass arguments to CMDLINE variable (InstallScript MSI projects only)

The /z argument is used to pass data to the InstallScript system variable CMDLINE, as in Setup.exe /z"My Custom Data", after which the variable CMDLINE would contain the string "My Custom Data".

Debugging

/d : Debug InstallScript (InstallScript projects only)

For an InstallScript project, running the command Setup.exe /d runs the installation program with the InstallScript debugger.

Debugging InstallScript code requires the debug-information file Setup.dbg to be available. To debug an InstallScript project on a system other than the development system:

  1. Copy the InstallScript debugger executable ISDbg.exe (located in the System folder of your InstallShield DevStudio distribution) to the test system, and register it by launching the executable with the /REGSERVER command line argument.
  2. Copy Setup.dbg to the test system.
  3. Run Setup.exe with the command Setup.exe /d"", where path is the directory containing Setup.dbg.

For a Basic MSI project, the command Setup.exe /v"ISSCRIPTDEBUG=1 ISSCRIPTDEBUGPATH=\"path-to-Setup.dbg\"" runs your InstallScript custom actions in the InstallScript debugger.

/verbose : Generate verbose InstallScript engine log file (InstallScript projects only)

For an InstallScript project, you can create a verbose InstallScript-engine-installation log file using the /verbose argument followed by the path to the log file you want to create. A typical command is Setup.exe /verbose"C:\IS.log". The log file generated can help you troubleshoot errors in installing the InstallScript engine on a target system. The /verbose option requires a full path to the log file, and not a relative path.

To create a verbose InstallScript log file every time you run an InstallScript installation program, you can create the registry key—

HKEY_CURRENT_USER\Software\InstallShield\DevStudio\9.0\SetupExeLog

—and inside the key create a string value called VerboseLogFileName, with data set to the path to the log file (as in C:\IS.log).

Miscellaneous

/delayedstart: : Delay initialization of the setup (InstallScript and InstallScript MSI projects only)

Specifies the amount of time (in seconds) by which initialization of the setup is delayed after Setup.exe is launched.

Using the -delayedstart option is recommended when manually launching an additional setup after reboot (for example, by using the RunOnce key). The delay allows the operation system to initialize completely; this prevents the problems—such as Remote Procedure Call (RPC) errors—that can occur if a setup initializes before the operating system has initialized completely. The recommended delay length is 30 seconds.

Note that this option is not needed when the setup starts automatically after reboot (for example, due to a call to SdFinishReboot before reboot).

/deleter : Do not clone a second Setup.exe process when debugging (InstallScript and InstallScript MSI projects only)

Use this option when debugging a DLL function that is called from your setup script. This option specifies that Setup.exe does not clone a second Setup.exe process to perform the actual work of the setup. (By default, Setup.exe clones a second process, so that it properly uninstalls applications from machines on which no InstallScript setup had previously been run.)

/extract_all: : Package's files should not be run but simply extracted (InstallScript and InstallScript MSI projects only)

Specifies that a self-extracting package's files should not be run but simply extracted to the location that is specified by .

/f : Specify alternative compiled script (InstallScript and InstallScript MSI projects only)

By default, Setup.exe looks for a compiled script file named Setup.inx. To specify a different name for the compiled script file, use the /f option, as in Setup.exe /f"script.inx".

The Setup.exe created by earlier versions of InstallShield—Windows Installer Edition used the /f option to repair an installation.

/h : Clone release to a temporary location and run from that location (Windows Installer based projects only)

The build engine automatically creates a setup that supports Setup.exe cloning in cases where cloning is required (for example, multi-disk setups). If you need to do this manually, pass /h to Setup.exe and it will clone itself to a temporary location and run from that location.

/hide_usd : Suppress update dialog box for multiple installations (InstallScript and InstallScript MSI projects only)

Suppresses display of the dialog box that is displayed by an update-enabled setup to let the end user select which of multiple installations of your product will be updated. This dialog box is displayed by default when an update-enabled setup detects multiple previous installations. When this command line option is used and an update-enabled setup detects multiple previous installations, the setup updates the first previous installation that it finds.

/ig : Specify the value of the system variable INSTANCE_GUID (InstallScript and InstallScript MSI projects only)

Specifies the value of the system variable INSTANCE_GUID; for example, -ig{722C7440-B317-4B3B-AECA-0199EA4E7CDB}. If this option is not used, the setup automatically assigns a value to INSTANCE_GUID (for multi-instance setups, this value is a newly generated GUID; for standard setups, this value is the same as the value of PRODUCT_GUID). This option is useful if you have created a setup launcher—that is, a custom application that runs before your setup does to perform pre-setup tasks, such as determining the instance GUID that you want to use for the setup. Do not specify anything other than a valid GUID with this option.

/L : Setup language

Users can use the /L switch with the decimal language ID to specify the language used by a multi-language installation program. For example, the command to specify German is Setup.exe /L1031 for Windows Installer based installations (including InstallScript MSI installations) or Setup.exe /L0007 for InstallScript installations.

/w : Wait (Windows Installer based projects only)

For a Basic MSI project, the /w argument forces Setup.exe to wait until the installation is complete before exiting.

If you are using the /w option in a batch file, you may want to precede the entire Setup.exe command line argument with start /WAIT. A properly formatted example of this usage is as follows:

start /WAIT setup.exe /w

/SMS : Wait (InstallScript MSI projects only)

For an InstallScript MSI project, Setup.exe automatically waits for the installation to finish before exiting, so this switch (used by earlier versions of InstallShield Professional) is no longer necessary.

No comments: