MSI upgrade and retain registry keys?

这一生的挚爱 提交于 2019-12-20 04:38:37

问题


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.

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.

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.

Edit: 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.


回答1:


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

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.



来源:https://stackoverflow.com/questions/10832482/msi-upgrade-and-retain-registry-keys

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