Question

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?

Was it helpful?

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.

OTHER TIPS

You can use RegistrySearch to get the value of a registry if it exists. For example:

  <Property Id="SQLCLRTYPES">
<RegistrySearch Id="SqlClrTypesSearch" Root="HKLM" Type="raw"
                Key="SOFTWARE\Microsoft\Microsoft SQL Server 2012 Redist\SQL Server System CLR Types\1033\CurrentVersion"
                Name="Version"/>

Also if you want to retain the value of an existing registry, you can use the NeverOverwrite attribute of the component to implement it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top