简体   繁体   English

如何将命令行参数传递给 MSI 安装程序

[英]How to Pass Command Line Arguments to MSI Installer

Now my team working in a project using Windows Application(C#) .现在我的团队在一个使用Windows Application(C#)的项目中工作。 We use MSI Installer for creating installation.我们使用MSI 安装程序来创建安装。

I didn't know how to pass command line parameters from MSI file & Setup.exe file.我不知道如何从 MSI 文件和 Setup.exe 文件传递​​命令行参数。

for example例如

setup.msi username=demo password=pass setup.msi 用户名=演示密码=通行证

setup.exe username=demo password=pass setup.exe 用户名=演示密码=通行证

Please suggest a good example/reference请提出一个很好的例子/参考

这篇代码项目文章有一个很好的例子来说明这一点。

You've got the right idea, but for the parameters to be available during the execute sequence, you'll need to pass public properties rather than private ones.您的想法是正确的,但是要使参数在执行序列期间可用,您需要传递公共属性而不是私有属性。 Names of public properties are all uppercase.公共属性的名称都是大写的。

For example, this would work:例如,这将起作用:

msiexec /i setup.msi USERNAME=yourUserName PASSWORD=yourPassword

Ed has it correct.埃德说得对。

For "Setup.exe" installers - that is outside of the scope of MSI because setup.exe installers are proprietary to the vendors.对于“Setup.exe”安装程序 - 这超出了 MSI 的范围,因为 setup.exe 安装程序是供应商专有的。 InstallShield, Wise and WiX use different setup.exe cmdline params to acheive the same result. InstallShield、Wise 和 WiX 使用不同的 setup.exe cmdline 参数来实现相同的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM