Wix installer cleans registry settings during repair

Currently, I have configured Wix_InstallDirDlg to allow the user to install the registry key during installation. There is a special dialog that appears after InstallDirDlg and MaintenanceTypeDlg so that it serves both installation and recovery scripts.

The user dialog box has one text box associated with the property. This property has a registry search, so if the user corrects or updates the previous value, it is saved and therefore is displayed in the user dialog for user verification. The dialog works fine during installation and a registry key is created. However, when restoring, the user dialog appears with the correct registry value entered (therefore, RegistrySearch works), but when the repair is completed, the key value is empty.

<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 did I do wrong?

+7
source share
2 answers

I managed to figure it out right after I posted. I spent almost the whole day trying to work it out so I hope this saves a bit of pain. All you have to do is change the property to a safe property.

 <Property Id='SERVER_LISTEN_URL' Secure='yes'> <RegistrySearch Id='ServerListenUrlRegSearch' Root='HKLM' Key='SOFTWARE\$(var.Manufacturer)\$(var.Name)' Name='ServerListenUrl' Type='raw' Win64='no' /> </Property> 
+7
source

Protected properties can transfer their content from the client process (run in the user context) to the server process (runs in the system context) during an "enhanced installation". In other words, an installation called by a non-administrator user. Do not be too generous about which features are made safe, but definitely add all the properties used in the Upgrade table and any special ones used in the GUI for important information like you did.

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

+3
source

All Articles