How to use it

  1. Pick the action: install, uninstall, repair, patch or administrative install.
  2. Type the path of the MSI file. For an uninstall or a repair you can type the product code.
  3. Pick the user interface level and the restart option.
  4. Type a log file path. Leave the box empty for no log.
  5. Tick the properties you need and add your own, one per line.
  6. Press Copy command or Copy PowerShell.

The tool puts quotes around every path. It also puts quotes around a property value that has a space in it.

What the switches do

  • /qn shows no window at all. Use it for SCCM and for scripts.
  • /qb shows a progress bar. /qb! hides the Cancel button.
  • /passive shows a progress bar and asks the user nothing.
  • /norestart stops the installer from restarting the PC.
  • /l*v writes a verbose log. Use it every time. The log is the only way to find the cause of a failed install.
  • TRANSFORMS= applies one or more .mst files to the install.

Exit codes you will meet

  • 0: success.
  • 1602: the user cancelled the install.
  • 1603: fatal error during the install. Open the log and search for "return value 3".
  • 1605: the product is not installed. You see this when you uninstall a product code that is not on the PC.
  • 1618: another install is already running. Wait and try again.
  • 1619: the package could not be opened. Check the path and the access rights.
  • 1641: success, and the installer started a restart.
  • 3010: success, and a restart is needed to finish.

In an SCCM deployment type, 0 means success, 3010 means soft reboot and 1641 means hard reboot by default.

Why use the PowerShell line?

At a command prompt, msiexec returns before the install ends. The PowerShell line uses -Wait, so your script waits for the install. -PassThru gives back the process, and $process.ExitCode holds the exit code.

Property names

Only public properties can be set on the command line. A public property has a name in upper case. The tool changes the names you type to upper case.

INSTALLDIR is a common name for the install folder, but each MSI picks its own name. Check the vendor guide or open the Directory table of the MSI.

Questions

Where do I find the product code for an uninstall?

Look in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and in the same key under WOW6432Node. Find the key with the right DisplayName. For an MSI install, the name of that key is the product code.

What is the difference between /norestart and REBOOT=ReallySuppress?

They do the same job. The /norestart switch sets REBOOT=ReallySuppress for you. One of them is enough. The exit code is 3010 when the install needs a restart.

What does MSIFASTINSTALL=7 do?

It makes large installs faster. The installer makes no system restore point, checks file costs only and sends fewer progress messages. It needs Windows Installer 5.0, which is in Windows 7 and newer.