Search code examples
wixwix3.5wix3wix3.6

WIX installation reading Registry


Can i retain WIX installed register values and show inside textbox.As i am storing some values inside registry, and i uninstalled the product.If i install the WIX setup how to check if registry value exist if exists then i want to get back the value from registry and dispaly to WIX textbox. Writing into registry i am doing like :-

 <Property Id="COUNTRIES">
<RegistrySearch Id="RegistryWrite" Type="raw" Root="HKLM" Key="SOFTWARE\MYTest\Test" Name="COUNTRIES" />
</Property>

  <RegistryKey Root="HKLM" Key="SOFTWARE\MYTest\Test" >
  <RegistryValue Name="COUNTRIES" Value="[COUNTRIES]" Type="string"  />

Can anyone help me now how to read values from registry while doing installation second time?


Solution

  • If I understand you correctly, you want to retain registry values between installations of you product, but things you add to registry are deleted in uninstall. Correct?

    In this case, mark the component that has the RegistryKey/RegistryValue elements as Permanent. This will keep it after uninstall.