我们使用MSIEXEC使用以下命令行选项安装应用程序(MSI):
MsiExec.exe /x{code} /qn /liwearucmopvx+ C:\Log\UnInstall.tra
MsiExec.exe /iC:\Source\App.msi /qn TARGETDIR=C:\Install ALLUSERS=1 /liwearucmopvx+ %C:\Log\Install.tra
Run Code Online (Sandbox Code Playgroud)
大多数情况下这是有效的,但有时卸载失败(不确定为什么,查看错误).无论如何,当发生这种情况时,我在重新安装期间遇到以下错误:
Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel
Run Code Online (Sandbox Code Playgroud)
有没有办法绕过这个?这意味着确保我们始终重新安装(如果存在,我们可以简单地自动将其吹走?)