Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
693 views
in Technique[技术] by (71.8m points)

windows installer - Automated MSI installation

What is the best way to automatically install an MSI file or installer .exe? We want to do some automated testing from our build system on the installed copy of the product. Our installer has the usual license acceptance screen, install location, etc.


As FryHard pointed out there are two options in particular that seem handy:

  • "/quiet" - no use interaction
  • "/passive" - process bar only, unattended mode
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To automate the installation of an MSI package, you can use the /I option, like this:

msiexec.exe /qn /i mypackage.msi

Keep in mind that you need to specify the properties the MSI package expect the user to specify through the UI, and for which it does not have a default value.

You can use the Orca tool to see the list of properties and fiddle around with MSI conditions, etc. And to set values for the properties, you can just specify it in command line; e.g. to set a property ISDEBUG:

msiexec.exe /qn /i mypackage.msi ISDEBUG=1

Side note: To automate uninstall, use the /X option with the package or the product code:

msiexec.exe /qn /x mypackage.msi

or this (where you need to change the CLSID with your product code):

msiexec.exe /qn /x {B741B8A3-8DCB-44E0-B06F-2A11F56572DB}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...