Is it possible to install an msi using python?

China☆狼群 提交于 2021-02-07 14:41:13

问题


Is it possible to write a script in python that installs an msi? Or is it possible to make it through any other script?


回答1:


You can use the antiquated os.system('msiexec /i whatever.msi'), or, better, the subprocess equivalent subprocess.call -- in either case, you can also add whatever further msiexec flags or arguments you desire (documentation in abundance here).




回答2:


AFAIK, it's possible to use WMI in Python, so you should be able to install MSI files using the Win32_Product.Install method.



来源:https://stackoverflow.com/questions/3130252/is-it-possible-to-install-an-msi-using-python

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