0

I have a registry key (in HKEY_LOCAL_MACHINE hive) which must be keeped from older version of the application to the newer, but removed when user completely uninstalls my application. I'm using Visual Studio 2010 setup and deployment project.

I know about increasing build version of the installation package, build version of assemblies and upgrading 'ProductCode'(but keeping 'UpgradeCode' the same). 'RemovePreviousVersion' is set to true. The problem is that when user installs the new version, registry key from previous version is removed (with important data in it) and recreated again. It seems that MSI uninstalls my application before installing the new version. I was tried to set 'RemovePreviousVersion' to false but in this case new version installed independently and both versions of the application appear on the same machine. It seems to be very common scenario but I couldn't find how to keep registry keys between different versions. If you know how to make this modifying MSI package using Orca it is not a problem (as Visual Studio is very restricted in creating installation packages).

Thanks in advance.

4

1 回答 1

1

延迟安排 RemoveExistingProducts 操作将解决您的问题。

http://msdn.microsoft.com/en-us/library/windows/desktop/aa371197(v=vs.85).aspx

于 2013-01-16T06:23:18.777 回答