MSI upgrade and retain registry keys?

2019-03-01 08:54发布

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条回答
在下西门庆
2楼-- · 2019-03-01 09:01

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.

查看更多
登录 后发表回答