How to Pass Command Line Arguments to MSI Installe

2019-02-07 10:20发布

Now my team working in a project using Windows Application(C#). We use MSI Installer for creating installation.

I didn't know how to pass command line parameters from MSI file & Setup.exe file.

for example

setup.msi username=demo password=pass

setup.exe username=demo password=pass

Please suggest a good example/reference

3条回答
萌系小妹纸
2楼-- · 2019-02-07 10:49

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. InstallShield, Wise and WiX use different setup.exe cmdline params to acheive the same result.

查看更多
一夜七次
3楼-- · 2019-02-07 11:05

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

查看更多
Explosion°爆炸
4楼-- · 2019-02-07 11:07

This Code Project article has a pretty good example of doing this.

查看更多
登录 后发表回答