How do I do a silent install and uninstall with WiX and MSI?

半城伤御伤魂 提交于 2019-12-18 11:09:30

问题


How can a silent installer be created in WiX that does not display any UI dialogs to the user and installs, upgrades and uninstalls with default settings?


回答1:


Just don't include any UI/UIRef elements and then no UI will be included :)




回答2:


Windows Installer (MSI) uses the following command line arguments to be silent:

Silent install or silent major upgrade:

msiexec.exe /i foo.msi /qn

Silent minor upgrade:

msiexec.exe /i foo.msi REINSTALL=ALL REINSTALLMODE=vomus /qn

Silent uninstall:

msiexec.exe /x foo.msi /qn

Executable path:

C:\Windows\system32\msiexec.exe



回答3:


Installer .exe's created with WiX can be run from the command line without requiring user input by using one of these command line parameters:

  • /quiet - Displays no UI whatsoever
  • /passive - Displays a UI but requires no user input. Essentially just displays an install progress bar

This answer is based on WiX 3.9.




回答4:


All MSI installers whether created by WiX or not can be controlled via command line arguments. So you can make an installer with UI and still install it silently, there is no need to remove the UI from the installer just suppress it on the command line. Remember, make sure you add the upgrade element in your first installer so subsequent ones will match



来源:https://stackoverflow.com/questions/2898993/how-do-i-do-a-silent-install-and-uninstall-with-wix-and-msi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!