Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silent installation of a MSI package

I have a MSI package that I need to install if the package is not already installed. Also I need to install it silently. The package prompts user for:

  • Installation location (C:\Program Files\Foobar)
  • Install type: minimal and full (minimal)

I need to override these two parameters using command line parameters or some other method. So how do I go about these two issues. I'll use VBScript for scripting.

like image 344
Salman A Avatar asked Dec 19 '11 10:12

Salman A


People also ask

How do I install MSI silently?

If you are looking for complete silence then you also need the MSI to run in quiet mode. You achieve this by running the msiexec.exe with the /qn switch. This switch means quiet and no interface.

Where is the silent install switch for MSI?

When you install an MSI file, you can be assured that certain parameters will exist, such as the silent parameter /quiet or /qn. You can get a list of the supported parameters in PowerShell or CMD by typing msiexec.exe /?. This command will display the usage statement.

What is MSI installation package?

What is an MSI file? An MSI file used to install and launch Windows programs; a complete package for Microsoft Windows that contains installation information for a typical software program, including essential files to be installed and information about the installation location.


2 Answers

You should be able to use the /quiet or /qn options with msiexec to perform a silent install.

MSI packages export public properties, which you can set with the PROPERTY=value syntax on the end of the msiexec parameters.

For example, this command installs a package with no UI and no reboot, with a log and two properties:

msiexec /i c:\path\to\package.msi /quiet /qn /norestart /log c:\path\to\install.log PROPERTY1=value1 PROPERTY2=value2 

You can read the options for msiexec by just running it with no options from Start -> Run.

like image 128
Polynomial Avatar answered Sep 19 '22 16:09

Polynomial


The proper way to install an MSI silently is via the msiexec.exe command line as follows:

msiexec.exe /i c:\setup.msi /QN /L*V "C:\Temp\msilog.log" 

Quick explanation:

 /L*V "C:\Temp\msilog.log"= verbose logging  /QN = run completely silently  /i = run install sequence  

There is a much more comprehensive answer here: Batch script to install MSI. This answer provides details on the msiexec.exe command line options and a description of how to find the "public properties" that you can set on the command line at install time. These properties are generally different for each MSI.

like image 41
Stein Åsmul Avatar answered Sep 20 '22 16:09

Stein Åsmul