Silent install parameters for Windows applications
Most Windows applications can be installed very easily using the graphical installation assistant by clicking Next-Next-Finish. This always works quite the same way regardless of the software vendor.
Unfortunately the graphical assistant cannot be used for automated silent software installations, as there is no user interaction involved. This means that the information, which is usually gathered via the graphical assistant, has to be passed via the command line. However, this varies largely depending on the underlying installation technology.
During my automation project for Windows environments I got in touch with six different installers. All of them need their own specific parameters for a silent installation. In the following I will describe the different installers, how to identify them, and which parameters are necessary for an automated installation.
Microsoft Installer (MSI)
Microsoft’s preferred installation technology is the so called Windows Installer, formerly known as Microsoft Installer. Usually only few software products are bundled using this installer. This installer can be identified quite easily. A setup file based on this installer is always extended with .msi.
MSI should be called with the following silent install parameters: msiexec /package installer.msi /qn /LV+ "C:\logs\myApp.log" TARGETDIR="C:\tools\myApp" INSTALLDIR="C:\tools\myApp"
This example installs the application into C:\tools\myApp and appends a verbose installation protocol to C:\logs\myApp.log.
Since MSI routines tend to ignore the INSTALLDIR parameter in favor of the TARGETDIR parameter, I recommend to pass both using the same value. Be aware, however, that some MSI routines ignore both parameters falling back to their default destination path.
The application can be uninstalled using the silent install parameters again: msiexec /uninstall installer.msi /qn /lv+ "C:\logs\myApp-uninstall.log"
The embedded MSI-Installer is a setup file with .exe extension. It is a package containing some application files and the MSI installer. To identify this kind of package run the following command in the Windows command line: findstr /M /C:"by the Windows Installer service" installer.exe
Of course you will have to replace the installer.exe with your own specific setup file. If this command prints one or more results the file might be an embedded MSI installer.
This installer uses the same silent install parameters as the default MSI installer, described above.
Depending on the implementation more silent install parameters are available and documented in the usage help (installer.exe /?).
You can not easily uninstall such applications, because there is no regular MSI file here. They have to be removed differently, e.g. using the uninstall entry from the Windows registry or the WMI service.
Inno Setup is a popular third party installer, which is available for free.
To identify such installer use findstr again: findstr /M /C:"Inno Setup" installer.exe
Working with this installer you need the following silent install parameters: installer.exe /VERYSILENT /SP- /LOG="C:\logs\myApp.log" /DIR="C:\tools\myApp"
Since /VERYSILENT is only used to disable installation process output you should also use /SUPPRESSMSGBOXES to suppress decision dialogues by using their default answers. Additionally the silent install parameter /SP- is used to suppress the initial confirmation dialogue.
The last and least standardised type of Windows installer is a self extracting ZIP archive. This installer usually can be identified through its icon or its file properties:
Unfortunately this installer type doesn’t accept any default silent install parameters. In my project I often extracted these archives and used the embedded installer which was one of the five listed above.