I am currently maintaining a piece of software that has loads of user defined registry keys. I'm trying to make a WIX installer that keeps these registry keys in tacted with the least amount of maintainability. I decided to make each value inside a registry key it's own component to allow me to use the NeverOverwrite='yes' feature of WIX. I assumed the existence of this would allow minor upgrades (ex. REINSTALL=ALL REINSTALLMODE=vomus) to create the value if it exists otherwise leave it alone. However this doesn't seem to be happening in my realworld example (No conditions on the feature) . The documentation is telling me I should be good. Here is a few samples:
<Product Id="UNIQUE_KEY" Name="Spotbox Manager" Language="1033" Version="1.0.1.0" Manufacturer="Company" UpgradeCode="MY_UPGRADE_KEY">
<Package Platform="x64" Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" />
<Upgrade Id="MY_UPGRADE_KEY">
<UpgradeVersion OnlyDetect='yes' Property='SELFFOUND'
Minimum='1.0.1' IncludeMinimum='yes'
Maximum='1.0.1' IncludeMaximum='yes' />
<UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
Minimum='1.0.1' IncludeMinimum='no' />
</Upgrade>
This is the actual Fragments for the Registry Keys
<Component Id="cmp171812fcc51a4b91ad386fa8c27c9b89" Directory="TARGETDIR" Guid="COMPONENT_GUID" Win64='yes' NeverOverwrite='yes'>
<RegistryKey Key="SOFTWARE\Company" Root="HKLM">
<RegistryValue Name="Value" Value="1100797834" Type="integer" KeyPath='yes'/>
</RegistryKey>
</Component>
<Component Id="cmp211639bff9694f029028a22cb0bb9687" Directory="TARGETDIR" Guid="NEW COMPONENT GUID" Win64='yes' NeverOverwrite='yes'>
<RegistryKey Key="SOFTWARE\Company" Root="HKLM">
<RegistryValue Name="Country Code" Value="1" Type="integer" KeyPath='yes' />
</RegistryKey>
</Component> ...
Please Note: The Key is the same for both values This still seems to blow away the user's value when I try and change it.