I created a RegistryKey and a RegistryValue nested inside this RegistryKey. Later I created another RegistryValue - not nested inside whatever RegistryKey in WiX's XML scheme. But I want to this second RegistryValue be inside the first RegistryKey actually after the installation complete. So I want to refer from many RegistryValue's to a single RegistryKey. How to do it?
It also requires that various registry values will be inside various components, so I can't put all the registry values inside a single registry key within the WiX scheme.
The example is presented below.
<Component>
<RegistryValue
Root="HKLM"
Name="ShortcutInstalled"
Key="SetupAndAccessoryData1"
Type="integer"
Value="1"
KeyPath="yes"
/>
</Component>
<Component>
<RegistryKey
Id="SetupAndAccessoryData1"
Action="createAndRemoveOnUninstall"
Key="SOFTWARE\$(var.Manufacturer)\$(var.ProductName)\SetupAndAccessoryData"
Root="HKLM"
>
<RegistryValue
Type="string"
Name="InstallDirectory"
Value="[ProductDirectory]"
KeyPath="yes"
>
</RegistryValue>
</RegistryKey>
</Component>
For now I must fill the Key attribute of the ShortcutInstalled RegistryValue with the same data as in the Key attribute at the RegistryKey. But I don't want to copy and paste it because of refactoring difficulties. I just want to refer to the same registry key. What is the best approach to gain it?