We use WiX 3.5 to build the installer for one of our products. For simplicity, we process version updates using a major update, for example:
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="Laterversionfound" />
We do not specify the Schedule attribute, which means that the RemoveExistingProducts action should be launched after "InstallValidate" - this means that the old version will be fully installed before the new version is installed.
We install some HKLM registry settings that the user must configure after installation. Since the main update performs a complete uninstallation and subsequent reinstallation, we lose user settings in the registry. Ideally, we should be able to support these updates.
My registry key components are as follows:
<Component Id="regserver" Guid="[guid]"> <RegistryValue Root="HKLM" Key="Software\Our Company\Our Product" Name="Server" Value="" Type="string" KeyPath="yes" /> </Component>
I tried setting the NeverOverwrite property to yes components, but this leads to an unsuccessful result of refusing to recreate the keys - apparently because it checks to see if the keys exist before deletion (which, obviously, they do), then they are deleted with deleted but not recreated again.
I also tried setting the RemoveFeatures attribute on the MajorUpgrade element to remove everything except the reg keys. This leaves the two versions of the product installed because the function containing the reg keys belongs to the old version.
My next step is to try to plan the RemoveExistingProducts option at a different point, although I expect some pain in some of our custom actions.
So my question is, is there a way to achieve what we need without changing the location where RemoveExistingProducts is planned?