MSIEXEC

Microsoft Windows Installer.

Syntax
      MSIEXEC /Option RequiredParameter [OptionalParameter]

Install Options:

   Install or configure a product:
      MSIEXEC /package Product.msi
      MSIEXEC /i Product.msi

   Administrative install, Install a product on the network:
      MSIEXEC /a Product.msi

   Advertise a product to all users:
      MSIEXEC /j m Product.msi [/t TransformList] [/g LanguageID]

   Advertise a product to current user:
      MSIEXEC /j u Product.msi [/t TransformList] [/g LanguageID]

   Uninstall the product:
      MSIEXEC /uninstall Product.msi
      MSIEXEC /x Product.msi
      MSIEXEC /uninstall ProductCode
      MSIEXEC /x ProductCode
   Extract files from an MSI:
      MSIEXEC /a MSIFile /qb TARGETDIR=DestinationDirectory

Display Options:

   Quiet mode, no user interaction
      /quiet

   Unattended mode - progress bar only
      /passive

   Set user interface level: None
      /qn

   Set user interface level: Basic UI
      /qb

   Set user interface level: Reduced UI
      /qr

   Set user interface level: Full UI (default)
      /qf

   Help information
      /help
                
Restart Options:

   Do not restart after the installation is complete:
      /norestart

   Prompt the user for restart if necessary:
      /promptrestart

   Always restart the computer after installation:
      /forcerestart
             
Logging Options:

   /le Logfile  Log All error messages
   /lw Logfile  Log Non-fatal warnings
   /li Logfile  Log Status messages
   /la Logfile  Log Start up of actions
   /lr Logfile  Log Action-specific records
   /lu Logfile  Log User requests
   /lc Logfile  Log Initial (UI) parameters
   /lm Logfile  Log Out-of-memory or fatal exit information
   /lo Logfile  Log Out-of-disk-space messages
   /lp Logfile  Log Terminal properties
   /lv Logfile  Log Verbose output
   /lx Logfile  Log Extra debugging information

   /l* Logfile  Log all information, except for v and x options
   /log Logfile Equivalent of /l* 

   /l+ Logfile  Append to an existing log file.
   /l! Logfile  Flush each line to the log.

Update Options:

   Apply update(s)
      /update [;Update2.msp]

   Remove update(s) for a product:
      /uninstall [;Update2.msp] /package 
                
Repair Options:

   /fp          Repair/fix - replace missing files
   /fo          Repair/fix - replace Older files(default)
   /fe          Repair/fix - replace older or Equal date files
   /fd          Repair/fix - replace Different version files
   /fc          Repair/fix - replace files based on Checksum differences
   /fa          Repair/fix - replace All files
   /fu          Repair/fix - rewrite HKCU registry(default)
   /fm          Repair/fix - rewrite HKLM registry(default)
   /fs          Repair/fix - recreate shortcuts(default)
   /fv          Repair/fix - rewrite local cache from source

Set Public Properties
        [PROPERTY=PropertyValue]

Product codes:

The ProductCode for each application is a GUID that can be retrieved with a WMI query in VBScript or PowerShell, Get-CimInstance Win32_Product will return the IdentifyingNumber which is the installed ProductCode:

PS C:\> gcim Win32_Product -Filter "Name LIKE 'Paint.net%'" | Select name, IdentifyingNumber, LocalPackage

Win32_Product should be used with extreme caution as it will perform a reconfigure (repair) of all installed applications, see Q974524.

The ProductCode should be unique for each installed product, the same ProductCode will be found on multiple machines if they have the same software installed. So run the query on a test machine and store the product codes somewhere.

Windows installer (and msiexec) have been updated with each major release of Windows, Installer redistributables are available at the Microsoft Download Center.

All Command-line options are case insensitive.

Msiexec sets an error level on return that corresponds to System Error Codes.

Do not use the domain controller SYSVOL folder as a Windows Installer installation point, doing so can result in the following error when you attempt to run the Windows Installer (.msi) package:

This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.

This is because the SYSVOL folder is created with the SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS attribute, which prevents it from being exclusively locked by Windows Installer. Having locked files on a SYSVOL will create Active Directory directory service synchronization problems.

Registry Keys:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Examples

Install an application from a .MSI file:
msiexec /i "C:\Install\ss64app.msi"

UnInstall a program, using its GUID:
msiexec /uninstall "{5AFF6499-63BA-4A36-83B2-8D256404AC3D}" /log "C:\install\ss64app.txt"

or remotely with psexec
psexec \\$workstation -s msiexec /uninstall "{5AFF6499-63BA-4A36-83B2-8D256404AC3D}" /log "C:\install\ss64app.txt"

Extract the files from a .MSI installer:

msiexec /a proginstall.msi /qb TARGETDIR=C:\demo\extractedprog

“People don’t resist change. They resist being changed!” - Peter Senge.

Related commands

CHANGE - Terminal Server session install mode.
MSIinfo - Edit or display the summary information stream of an MSI database. (Windows Installer SDK).
ORCA - A database table editor for creating and editing Windows Installer packages and merge modules. (Windows Installer SDK).
REGSVR32 - Register or unregister a DLL.
RunDll32 - Uninstall DLL's e.g. MS Java.
WINGET - Windows Package Manager.
docs.microsoft.com - Released Versions of Windows Installer.
Q310747 - System File Checker (Sfc.exe)
Equivalent bash command (Linux): RPM - Rpm Package Manager.


 
Copyright © 1999-2023 SS64.com
Some rights reserved