MSI 升级并保留注册表项? [英] MSI upgrade and retain registry keys?

查看:26
本文介绍了MSI 升级并保留注册表项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在该领域有一个产品 1.0.我正在尝试更新该产品的安装程序,以便它可以安装在旧版本上,以安装新版本 2.0.我正在使用 Visual Studio 2010 安装项目来执行此操作.

We have a product, 1.0, in the field. I am trying to update the installer for that product so it can install over the old version, to install a new version, 2.0. I'm using a Visual Studio 2010 setup project to do this.

我已经维护了UpgradeCode,并将remove early versions 设置为true,新安装程序会成功安装旧版本,删除旧版本.

I have maintained the UpgradeCode, and set remove earlier versions to true, and the new installer will successfully install over the old one, removing the old one.

但是,旧 MSI 的卸载似乎发生在 安装新 MSI 之后.两个 MSI 都部署相同的注册表项(因为我们使用它们的代码没有改变)……但这意味着当旧的 MSI 卸载时,它会删除这些注册表项.而且由于卸载是在安装新 MSI 之后发生的……那些密钥就不见了.

However, it appears that the uninstall of the old MSI happens after the install of the new MSI. Both MSIs deploy the same registry keys (since our code that uses them hasn't changed)... but that means when the old MSI uninstalls, it removes those registry keys. And since that uninstall happens after the install of the new MSI... those keys are just gone.

有什么简单的方法可以防止这种情况发生吗?这似乎是一个非常正常的用例,但我不知道如果旧的安装程序删除它们,我应该如何维护这些注册表项.

Is there an easy way to prevent this? This seems like a pretty normal use case, but I can't figure out how I'm supposed to maintain those registry keys if the old installer removes them.

所以,我想出了如何在流程的早期移动 RemoveExistingProduct 步骤.我再次检查 - 是的,在 VS2005 中它首先完成,在 2010 年它几乎是最后完成的.如果旧的卸载程序删除了新安装程序添加的内容,我不确定他们希望如何工作......无论如何,这只是获取 Orca 并编辑步骤序列号的问题.

So, I figured out how to move the RemoveExistingProduct step earlier in the process. And I double checked - yes, in VS2005 it was done first, in 2010 it's done nearly last. I'm not sure how they expect that to work, if the old uninstaller removes things that the new installer adds.... anyway, it's just a matter of getting Orca and editing the step's sequence number.

推荐答案

听起来您可能需要放置 RemoveExistingProducts 按照安装程序顺序执行操作 - 可能是 InstallValidate 操作.

It sounds like you might need to place the RemoveExistingProducts Action up in the installer sequence - perhaps to the InstallValidate action.

恐怕我不知道如何使用 Visual Studio 完成此操作 - 我使用 Advanced Installer,因为我发现它提供了一个更简单的界面来构建和管理安装包.

I am afraid I don't know how to accomplish this with Visual Studio - I use Advanced Installer because I've found it provides a much easier interface to building and managing installation packages.

这篇关于MSI 升级并保留注册表项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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