MSI (Windows Installer) — silent install switches
An MSI is installed by Windows Installer, so the switches belong to msiexec, not to the package. The same line works for every MSI.
Version 1.9.2. Find the switches for any installer · All installer types.
Silent install command
msiexec /i "{file}" /qn /norestart
Alternative:
msiexec /i "{file}" /qb
Silent uninstall
msiexec /x "{ProductCode}" /qn /norestart
{file} is the quoted path of the installer. {app} is the folder the app was installed to. {ProductCode} is the MSI product code.
Switches
| Switch | Meaning |
|---|---|
/i | Install the package. |
/x | Uninstall by package path or by {ProductCode}. |
/qn | No user interface at all. |
/qb | Basic interface: a progress bar and no prompts. |
/norestart | Never restart. Exit code 3010 reports a pending restart. |
/l*v "%TEMP%\install.log" | Verbose log of the install. |
ALLUSERS=1 | Install for the machine, not for one user. |
REBOOT=ReallySuppress | Suppress every restart request. |
TRANSFORMS="app.mst" | Apply a transform file. |
Rules that trip people up
- Quote the path.
msiexec /i C:\My Apps\app.msifails because of the space. - Public properties such as
ALLUSERSare upper case and case-sensitive. msiexecis a Windows program, so a batch file does not wait for it. Usestart /wait msiexec ..., orStart-Process msiexec -Waitin PowerShell, to get the exit code.- Exit code
0is success,3010is success with a restart pending,1641started a restart,1618means another install is running, and1603is a fatal error. Read the/l*vlog for the cause.
How to tell the installer is MSI
The file ends in .msi. Windows Installer stores a ProductCode in the package, and InstallScout reads it for the uninstall command and for detection.
Use it in Intune
Intune can detect an MSI by its product code. InstallScout uses the ProductCode: it looks for that uninstall key and a version equal to or newer than the package. The Win32 app returns 0 and 1707 as success, 3010 as soft reboot, 1641 as hard reboot, and 1618 as retry.
Let InstallScout find it
Drop the file on InstallScout and click Analyze. It reads the file, names the engine, and writes this command with the path filled in. The installer is not run. The same lookup from a prompt:
.\InstallScoutPortable.exe --cli "C:\installers\setup.exe"
Then Intune package builds a PSADT .intunewin, and Upload to Intune sends the Win32 app.
Frequently asked questions
How do I install an MSI silently?
Run msiexec /i "C:\path\app.msi" /qn /norestart. /qn removes the interface and /norestart stops a restart.
How do I uninstall an MSI silently?
Run msiexec /x {ProductCode} /qn /norestart. The product code is in the package, and an installed product has it as the name of its key under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
What does MSI exit code 3010 mean?
The install worked, and a restart is pending. Intune reads it as a soft reboot. Add REBOOT=ReallySuppress to keep the machine from restarting.
Inno Setup · NSIS · InstallShield · WiX Burn · Advanced Installer · MSIX