MsiExec.exe command-line optionsΒΆ

MsiExec.exe is used to install/repair/uninstall MSI packages from the command line.

Note

Command-line options are case-insensitive.


Syntax:

msiexec <install option> "package"/{ProductCode} [optional parameters]

Usage:

msiexec /i "C:\package.msi" /qb
msiexec /i "C:\package.msi" /l*v "C:\package_install.log" /qb
msiexec /i "C:\package.msi" TRANSFORMS="C:\transform.mst" /qb
msiexec /i "C:\package.msi" PATCH="C:\patch1.msp;C:\PKG\patch2.msp" /qb
msiexec /a "C:\package.msi" TARGETDIR="C:\admin_install" /qb
msiexec /p "C:\patch1.msp;C:\patch2.msp" /qb
msiexec /f {FC1EBBED-AFE1-4760-96B0-623F5AC7070C} /qn
msiexec /x {FC1EBBED-AFE1-4760-96B0-623F5AC7070C} /qn

Install options (required)

Option

Description

/i

Install or configure a product.

After this option must follow either package.msi or {ProductCode}.

Example: msiexec /i "C:\package.msi"

To install MSI with MST:
msiexec /i "C:\package.msi" TRANSFORMS="C:\transform.mst"
To install MSI and MSP:
msiexec /i "C:\package.msi" PATCH="C:\patch.msp
To install MSI and set public property:
msiexec /i "C:\package.msi" PROPERTY=VALUE

/a

Install a product on the network. Administrative installation option.

After this option must follow package.msi.

Example 1: msiexec /a "C:\package.msi"
Example 2: msiexec /a "C:\package.msi" TARGETDIR="C:\admin_install"

/f

Repair a product.

After this option must follow either package.msi or {ProductCode}.

Note

This option ignores any property values entered on the command line.

This option can be supplemented with the additional flags, entered without spaces. If no flags are specified, the default is omus. List of available flags:

  • p - Reinstalls only if file is missing.

  • o - Reinstalls if file is missing or an older version is installed.

  • e - Reinstalls if file is missing or an equal or older version is installed.

  • d - Reinstalls if file is missing or a different version is installed.

  • c - Reinstalls if file is missing or the stored checksum does not match the calculated value. Only repairs files that have msidbFileAttributesChecksum in the Attributes column of the File table.

  • a - Forces all files to be reinstalled.

  • u - Rewrites all required user-specific registry entries.

  • m - Rewrites all required computer-specific registry entries.

  • s - Overwrites all existing shortcuts.

  • v - Runs from source and re-caches the local package. Do not use the v reinstall option for the first installation of an application or feature.

Example 1: msiexec /f {FC1EBBED-AFE1-4760-96B0-623F5AC7070C}
Example 2: msiexec /famus {FC1EBBED-AFE1-4760-96B0-623F5AC7070C}

/x

Uninstall a product.

After this option must follow either package.msi or {ProductCode}.

Example: msiexec /x {FC1EBBED-AFE1-4760-96B0-623F5AC7070C}

/j

Advertise a product.

After this option must follow package.msi or package.msi /t <transform list> or package.msi /g <LanguageID>.

Note

This option ignores any property values entered on the command line.

This option must be supplemented with the additional flag, entered without spaces.

  • u - Advertise to the current user.

  • m - Advertise to all users of machine.

Example: msiexec /jm "C:\package.msi" /t transform.mst

/p

Apply a patch to the installed product.

After this option must follow patch.msp.

To apply a patch to an installed administrative image you must combine the following options: /a "package.msi" /p "patch.msp"

Example: msiexec /p "C:\patch1.msp;C:\patch2.msp" /qb

Warning

The install option is mandatory. Only one install option should be used. The one exception to this rule is that patching an administrative installation requires using both /p and /a.


Display options (optional)

Option

Description

/q

Sets user interface level.

For more information, see UI levels description.

This option can be supplemented with the additional flags, entered without spaces. If no flags are specified, the default is n. List of available flags:

  • q , qn - No UI

  • qb - Basic UI. Use qb! to hide the Cancel button.

  • qr - Reduced UI with no modal dialog box displayed at the end of the installation.

  • qf - Full UI and any authored FatalError, UserExit, or Exit modal dialog boxes at the end.

  • qn+ - No UI except for a modal dialog box displayed at the end.

  • qb+ - Basic UI with a modal dialog box displayed at the end. The modal box is not displayed if the user cancels the installation. Use qb+! or qb!+ to hide the Cancel button.

  • qb- - Basic UI with no modal dialog boxes. Please note that /qb+- is not a supported UI level. Use qb-! or qb!- to hide the Cancel button. Note that the ! option is available with Windows Installer 2.0 and works only with basic UI. It is not valid with full UI.

Example: msiexec /i "C:\package.msi" /qb


Logging options (optional)

Option

Description

/l

Writes logging information into a logfile at the specified existing path. The path to the logfile location must already exist. The installer does not create the directory structure for the logfile.

This option can be supplemented with the additional flags, entered without spaces. If no flags are specified, the default is iwearmo. List of available flags:

  • i - Status messages.

  • w - Nonfatal warnings.

  • e - All error messages.

  • a - Start up of actions.

  • r - Action-specific records.

  • u - User requests.

  • c - Initial UI parameters.

  • m - Out-of-memory or fatal exit information.

  • o - Out-of-disk-space messages.

  • p - Terminal properties.

  • v - Verbose output.

  • x - Extra debugging information. Windows Installer 2.0: Not supported. The x option is available with Windows Installer version 3.0.3790.2180 and later.

  • + - Append to existing file.

  • ! - Flush each line to the log.

  • * - Wildcard, log all information except for the v and x options. To include the v and x options, specify /l*vx.

Note

For more information about all the methods that are available for setting the logging mode, see Normal Logging in the Windows Installer Logging section.

Example: msiexec /i "C:\package.msi" /l*v "C:\package_install.log" /qb


Restart options (optional)

The restart options are control setting the MSI PUBLIC properies PROPERTY=Value.

Property

Value

REBOOT

ReallySuppress

Never restart option

The installer never restarts the computer after the installation.

Example: msiexec /i "C:\package.msi" REBOOT=ReallySuppress

REBOOT

Force

Always restart option.

The installer always restarts the computer after every installation.

Example: msiexec /i "C:\package.msi" REBOOT=Force

REBOOTPROMPT

S or Suppress

Do not prompt before restarting option.

Setting this property does not initiate a reboot if one is not needed, it only suppresses the display of any prompts for reboots to the user.

Example: msiexec /i "C:\package.msi" REBOOTPROMPT=S

REBOOTPROMPT

""

Prompt before restarting option.

Displays a message that a restart is required to complete the installation and asks the user whether to restart the system now. This option cannot be used together with the /qn option.

Example: msiexec /i "C:\package.msi" REBOOTPROMPT=""

Note

Only PUBLIC PROPERTIES can be modified using the command line. All property names on the command line are interpreted as uppercase but the value retains case sensitivity. If you enter MyProperty at a command line, the installer overrides the value of MYPROPERTY and not the value of MyProperty in the Property table.


For more information, see Windows Installer Command-Line Options at docs.microsoft.com.




Note

PACE Suite covers the whole range of application packaging tasks - learn more.

Try PACE Suite for free - 21 days no obligations unlimited trial with all functions unlocked.