如何使用msiexec安装程序以静默方式安装MSI软件包并列出选

如何使用msiexec安装程序以静默方式安装MSI软件包并列出选

本文介绍了如何使用msiexec安装程序以静默方式安装MSI软件包并列出选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装带有大约10个选项的MSI软件包.我希望在.txt file中创建这些选项,并在安装过程中使用以下脚本通过命令行将这些选项传递给msiexec.exe:

I am trying to install an MSI package with around 10 options. I was hoping to create these options in a .txt file and pass those through to msiexec.exe during the install via the command line using a script such as this:

   C:\Windows\System32\msiexec.exe /qn /i "C:\folder\Installer.msi" /L*V "C:\folder\Installerlog.txt" /t "C:\folder\Installer.switch.txt"

我的installer.switch.txt文件具有类似于以下的结构:

My installer.switch.txt file has a structure similar to this:

Option1=option1 ^
Option1=option2 ^
Option1=option3 ^

因此,我希望通过installer.switch.txt文件传递选项.您能否先请教一下这是否可行,其次我可能会在语法中犯哪些错误.

With this I hope to pass the options via the installer.switch.txt file. Could you please advise on firstly if this is possible and secondly which errors I might be making in the syntax.

谢谢

推荐答案

我从未见过与msiexec.exe一起使用的开关/t-这是您自己的发明,用于指示带有开关的文本文件"吗?有内置的方法可以设置不依赖于文本文件的安装参数和设置.

I have never seen the switch /t used with msiexec.exe - is this your own invention to indicate "text file with switches"? There are built-in ways to set installation parameters and settings that don't rely on text files.

基本上,您可以设置通过命令行在MSI内部使用的公共属性,或者您可以使用 transform (我觉得更好).转换是部分数据库文件(一个MSI片段),用于在安装时更改原始MSI,以自定义MSI文件中您喜欢的任何内容.

Essentially you can set public properties used inside the MSI via the command line OR you can use a transform (which I find better). A transform is a partial database file - an MSI fragment - which is applied to change the original MSI at install time to customize anything you like in the MSI file.

换句话说,我将使用转换来设置这些选项,然后通过msiexec.exe将其应用,如顶部部分中所述: .链接的答案很长,只需查找有关公共财产的部分,然后在每个选项前面加上数字1和2即可进行转换.

In other words, I would use a transform to set these options and then apply it via msiexec.exe as described here in the top sections: How to make better use of MSI files. The linked answer is quite long, just look for the sections on public properties and transform with the numbers 1 and 2 in front of each option.

技术说明上:我会将要用于自定义的任何属性添加到 SecureCustomProperties 列表,以确保可以将其传递到延迟模式服务器安装过程.

On a technical note: I would add any properties you want to use for your customizations to the SecureCustomProperties list to ensure they can be passed to the deferred mode server installation process.

这是非常技术性的,但在边缘情况下可能很重要.它涉及到具有较高权限(而不是管理员权限)的用户的安装技术.只需将所有自定义的属性添加到MSI的属性表中设置的SecureCustomProperties列表中即可.您的SecureCustomProperties列表将显示为:PROP1; PROP2; PROP3等...您在转换中进行了设置.

This is quite technical, but may be important in fringe cases. It involves technicalities with regards to users installing with elevated rights (not admin rights). Just add all customized properties to the SecureCustomProperties list set in the MSI's property table. Your SecureCustomProperties list would read something like: PROP1;PROP2;PROP3 etc... You set this in your transform.

这篇关于如何使用msiexec安装程序以静默方式安装MSI软件包并列出选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 14:27