MSI 包的静默安装

我有一个 MSI 软件包,我需要安装,如果该软件包尚未安装。我还需要安装它静默。该软件包提示用户:

  • 安装位置(C: Program Files Foobar)
  • 安装类型: 最小和完整(最小)

我需要使用命令行参数或其他方法重写这两个参数。那么我该如何处理这两个问题呢。我将使用 VBScript 编写脚本。

367986 次浏览

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.

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.