当新版本发布时,如何重新安装 MSI?

发布于 2024-10-07 22:00:19 字数 125 浏览 2 评论 0原文

我已经在我的电脑上安装了该设置。然后我对代码进行了一些更改,并使用新代码构建了 MSI。现在,当我尝试安装该应用程序时,出现错误“已安装该产品的另一个版本,请删除旧版本”。

我不想显示此警告,而是想重新安装它。这可能吗?

I already installed the setup in my PC. Then I made some changes in my code and built the MSI with new one. Now when I tried to install the application I am getting an error as "Another version of the product is already installed please remove the older one".

Instead of displaying this warning, I would like to re-install it. Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

很快妥协 2024-10-14 22:00:19

卸载旧版本,然后重新安装新版本。

否则,您需要创建一个能够更新您的应用程序的安装程序。原因是 ProductCode GUID(标识要安装到 Windows 的应用程序)已被应用程序的先前实例使用。

您可以通过将 RemovePreviousVersions 属性设置为 True 来指定安装程序删除它找到的应用程序的任何早期版本。您还需要增加 ProductCodePackageCode 以反映这是应用程序的升级版本。如果您采用此方法,您不想想要更改ProductCode,因为这样Windows 就会将要安装的内容视为完全不同的应用程序。您没有提及您使用什么来创建安装程序,因此很难提供更多详细信息。在 Visual Studio 中,您可以在设计器中设置这些属性:

     Visual Studio 部署项目属性

或者,如果您使用 WiX,您应该会看到此问题的答案< /a>.

Uninstall the old version, and then re-install the new one.

Otherwise, you'll need to create an installer that is capable of updating your application. The reason is that the ProductCode GUID, which identifies the application about to be installed to Windows, is already in use by the previous instance of your application.

You can specify that your installer remove any previous versions of the application that it finds by setting the RemovePreviousVersions property to True. You'll also need to increment the ProductCode and PackageCode to reflect that this is an upgraded version of the application. You do not want to change the ProductCode if you go this route, because then Windows will see what's about to be installed as an entirely different application. You don't mention what you're using to create the installer, so it's difficult to provide any more details. In Visual Studio, you can set these properties in the designer:

     Visual Studio Deployment Project Properties

Or, if you're using WiX, you should see the answers to this question.

末が日狂欢 2024-10-14 22:00:19

您收到该消息是因为您的 PackageCode 已更改,但您的 ProductCode 未更改。要安装较新的版本,您需要运行 msiexec /i foo.msi REINSTALL=ALL REINSTALLMODE=vomus。 InstallShield 等工具可以生成 setup.exe 来检测此状态并为您处理。

但我想解决我更广泛的担忧。您需要彻底了解 Windows Installer 服务策略。您需要选择要支持的升级和补丁类型,并在投入生产之前对其进行测试。此外,在不了解降低风险所需的知识的情况下,在自己的计算机上进行安装也是在玩火。这就是虚拟机快照的用途。

You are getting that message because your PackageCode has changed but your ProductCode hasn't. To install the newer version you'll need to run msiexec /i foo.msi REINSTALL=ALL REINSTALLMODE=vomus. Tools like InstallShield can generate a setup.exe to detect this state and handle it for you.

But I'd like to address a broader concern that I have. You need to understand thoroughly Windows Installer Servicing Strategies. You need to choose what type of upgrades and patches you want to support and test it before you go into production. Additionally you are playing with fire by installing on your own machine without the knowledge needed to mitigate the risks. This is what virtual machine snapshots are for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文