如何让 msiexec 根据需要安装和/或重新安装 [英] How to get msiexec to install and/or reinstall as necessary

查看:13
本文介绍了如何让 msiexec 根据需要安装和/或重新安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网络驱动器上放置了一个内部 MSI,我想编写一个登录脚本,以便我们网络上的任何人都可以将 MSI 安装到他们的机器上,或者在 MSI 出现时自动重新安装它更新(经常发生).

I have an internal MSI placed on a network drive, and I'd like to write a login script so that anyone on our network can get the MSI installed onto their machines, or to get it auto-reinstalled whenever the MSI is updated (which happens often).

如果我使用 msiexec.exe/i REINSTALL=ALL,如果 MSI 尚未安装在该机器上,它将不会执行任何操作.如果我省略 REINSTALL=ALL,那么它将执行全新安装,但不会执行更新/重新安装.

If I use msiexec.exe /i REINSTALL=ALL it will do nothing if the MSI has not yet been installed on that machine. If I leave out the REINSTALL=ALL, then it will do fresh installations, but will not do update/reinstall.

如果软件包尚未安装,我应该选择什么参数来使其进行全新安装,如果软件包已经安装,我应该选择什么参数进行完全重新安装?

What parameters should I choose to make it do a fresh installation if the package was not yet installed, and to do a full reinstall if the package was already installed?

先运行 msiexec/i 然后重新安装可能会起作用,但如果可能的话,我想避免这种情况.

Running msiexec /i first followed by a reinstall might work, but I'd like to avoid that if possible.

需要 /famus 的原因是这些是开发人员机器,有人可能会手动更新注册表或注册一组不同的 dll.该脚本的目的是即使 MSI 没有任何变化,开发者也可以运行该脚本轻松恢复到官方"环境.

The reason /famus is needed is that these are developer machines, and someone might manually update the registry or register a different set of dlls. The intention of the script is that even if there has not been any changes to the MSI, the developer can also run the script to easily revert back to "official" environment.

推荐答案

我最后用一个批处理文件解决了,先运行msiexec/famus,如果退出码是1605就会运行msiexec/i.

I solved it in the end with a batch file that runs msiexec /famus first, and if the exit code is 1605 it will run msiexec /i.

这篇关于如何让 msiexec 根据需要安装和/或重新安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆