## Setup Command-line Options and Property

When you run Setup you can use command-line options to change some of the parameters that Setup uses to install the application, such as display settings and default values for Setup properties.

Setup and Windows Installer use properties to control the applications installation process. The default values for Setup properties are defined in the Windows Installer package (MSI file). You can specify new property values on the command line or in the Setup settings file (Setup.ini).

> Note In most cases, command-line options override duplicate customizations in the Setup settings file (Setup.ini) or in a transform (MST file). Command-line options and properties are not supported by all MSI files.

/a

/f

/i

/j

/l

/noreboot

/p

/q

/settings

/x

property=value

/?

## /a [msifile]

Create an administrative installation point for the specified package (MSI file). The package must be in the same folder as Setup.exe, and both must be at the root of the administrative installation point.

Examples:

/a My.msi

/a "subfolder1\My.msi"

## /f[options][msifile]

Force repair of an application associated with the specified package (MSI file). The package must be in the same folder as Setup.exe, and both must be at the root of the administrative installation point. Alternatively, you can specify the product code for the package the product code can be copied from the [Product] section of the Setup settings file.

> Note You must specify the same package that was used to install the application originally.

Valid values for <i>options</i> include the following

a | Force reinstallation of all files regardless of checksum or version.
c | Reinstall file if missing or corrupt.
d | Reinstall file if missing or a different version is present.
e | Reinstall file if missing or an equal or older version is present.
m | Rewrite all required HKEY_LOCAL_MACHINE registry entries.
o | Reinstall file if missing or an older version is present.
p | Reinstall file only if missing.
s | Reinstall all shortcuts and overwrite existing shortcuts.
u | Rewrite all required HKEY_CURRENT_USER registry entries.
v | Retrieve the package from the original source and recache it on the local computer.

The Detect and Repair command in an applications performs the same function as /focums. Running Setup and selecting Reinstall performs the same function as /fecums. When you install, Windows Installer saves the MSI file on the local computer. When you use the /fvm option to force a recache and reinstallation, Windows Installer retrieves the MSI file from the original source and recaches it on the local computer. You can use the /fvm option to update client computers after you patch an administrative installation point.

> Important If a user applies a client (binary) patches to a computer, you cannot use /f to recache and reinstall on that computer from an updated administrative installation point. In this case, users must uninstall and reinstall from the updated administrative image.

Example:

/fpiwae My.msi

/fvm {12345678-1234-1234-1234-123456789123}

## /i [msifile]

Install applications using the specified package. The package must be in the same folder as Setup.exe.

> Note By default, Setup.exe directs Windows Installer to perform the same function as /i.

Examples:

/i My.msi

/i "subfolder1\My.msi"

## /j[option] [msifile] [/t mstfile]

Advertise the application on the computer and install on first use; you must specify an option to advertise the application to either the computer or the user. You can use /j only when running Setup from an administrative installation point or an image of the CD on the network. If no package is specified, Setup uses the package specified in Setup.ini. To apply a transform to the advertised application, use the option /t and specify an MST file.

Valid values for option include the following:

m | Advertise to all users on the computer.
u | Advertise to the current user.

> Note In addition to /t, you can use the following three command-line options when you use /j to advertise the application: /l, /q, and /settings.

Example:

/jm My.msi /t Custom.mst

## /l[options] logfile

Create a log of installation actions for Setup and a log file for each Windows Installer task. The /l option overrides default settings specified in the [Logging] section of Setup.ini.

Values for option include the following and capture the corresponding data:

a | Start of action notification
c | Initial UI parameters
e | Error messages
i | Information-only messages
m | Out-of-memory messages
o | Out-of-disk-space messages
p | Property table list in form property=value
r | Action data record; contains action-specific information
u | User request messages
v | Verbose includes debug messages
w | Warning messages
* | Turn on all logging options except v
+ | Append to existing log file

Logfile signifies the name and path of the log file to create. When you include (*) in the log file name, Setup creates a unique file name for each instance of Setup.

Example:

/lv* "%temp%\MyApp Setup(*).txt"

This command line creates the following log files:

- Setup.exe log file
  "%temp%\MyAppSetup(0001).text"

- Windows Installer log file for core packages
  "%temp%\MyApp(0001)_Task(0001).txt"

## /noreboot

Do not restart the computer or display a restart dialog box at the end of the installation. The /noreboot option sets the Windows Installer REBOOT property to ReallySuppress for each package included in the installation except the last one.

## /p [mspfile]

Apply an administrative update (MSP file) to a client installation. You can also use /p to apply an update to an administrative installation by including the /a option and the name and path of the MSI file on the administrative installation point. To apply the patch quietly, include /qb on the command line to generate a log file, include /l.

Examples:

msiexec /p [mspfile] /qb /l[options]

msiexec /p [mspfile] /a [msifile] /qb /l[options]

## /q[option]

Set the Setup user interface display level.

Valid values for options include the following:

b | Display only simple progress indicators and error messages (basic).
f | Display all dialog boxes and messages; equivalent to omitting the /q option (full).
n | Display no user interface; equivalent to specifying /q with no options (none).
r | Display all progress indicators and error messages but collect no user information (reduced).
- | Suppress all modal dialog boxes; used only with b.
+ | Add completion message to the n or b option.

> Note The completion message is displayed only when Setup does not have to restart the computer after the installation.

## /settings file

Specify a custom Setup settings file for Setup.exe to use in place of Setup.ini. The settings file must be in the same folder as Setup.exe, or the path must be included on the command line.

Example:

/settings MyApp.ini

## /x [msifile]

Remove the application associated with the specified package. The package must be in the same folder as Setup.exe, and both must be at the root of the administrative installation point.

> Note You must specify the same package that was used to install the application originally.

Example:

/x My.msi

## property=value

Specify a property value on the command line. If the value contains spaces, enclose it in quotation marks ("). To specify two or more property-value pairs, separate them with spaces.

ALLUSERS=[string] | Install application for all users of the computer or for only the current user. By default, Windows Installer installs for all users of the computer. Setting ALLUSERS to a null value ("") overrides this default behavior and installs per user. 1 = Install for all users of the computer; requires administrative privileges. 2 = Install for all users of the computer. "" = Install only for the user running Setup. ALLUSER=""
CDCACHE=[string] | Specify the level of caching. Auto = cache based on available disk space 1 = cache only what you install 2 = cache entire source 0 = cache disabled CDCACHE=auto
COMPANYNAME=[string] | Specify an organization name. COMPANYNAME=My Business
INSTALLLOCATION=[string] | Specify the installation location. INSTALLLOCATION=C:\Program Files\MyApp
LOCALCACHEDRIVE=[string] | Specify the drive that the installation files will be cached to. LOCALCACHEDRIVE=C
PIDKEY=[string] | Enter a 25-character volume license key on the Setup command line or in the Setup settings file. When you set the PIDKEY property, users are not required to enter a product key when they install. PIDKEY=123467890123456789012345
TRANSFORMS=[string] | Specify a transform to apply to the installation. TRANSFORMS=\\server\share\myApp\Custom.mst
USERNAME=[string] | Specify a default user name. USERNAME=Don Dunk