Currently I have customised the Wix_InstallDirDlg to enable the user to set a registry key on install. There is a custom dialog that is shown after both the InstallDirDlg and the MaintenanceTypeDlg so that it caters for both install and repair scenarios.
The custom dialog has a single textbox that is linked to a property. This property has a registry search so that if the user repairs or upgrades the previous value is preserved and therefore shown in the custom dialog for the user to validate. The dialog works fine on install and the registry key is created. However when repairing, the custom dialog appears with the correct registry value entered (so the RegistrySearch is working), but when the repair is completed, the key value is blank.
<Property Id='SERVER_LISTEN_URL'>
<RegistrySearch Id='ServerListenUrlRegSearch' Root='HKLM'
Key='SOFTWARE\$(var.Manufacturer)\$(var.Name)'
Name='ServerListenUrl'
Type='raw' Win64='no' />
</Property>
<Component Id="RegistryEntries" Guid="0234974B-6158-4312-90A7-56869809B42E">
<RegistryKey Id="ServerRegKey"
Root="HKLM"
Key='SOFTWARE\$(var.Manufacturer)\$(var.Name)'
Action='createAndRemoveOnUninstall'>
<RegistryValue Id="ServerListenUrlRegVal"
Name='ServerListenUrl'
Value='[SERVER_LISTEN_URL]'
KeyPath='yes'
Type='string' />
</RegistryKey>
</Component>
<Dialog Id="SettingsDlg">
<Control Id="ListenUrl" Type="Edit" X="20" Y="100" Width="320" Height="18" Property="SERVER_LISTEN_URL" Indirect="no" />
</Dialog>
What have I done wrong?