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="SOFTWAREMYTestTest" Name="COUNTRIES" />
</Property>

  <RegistryKey Root="HKLM" Key="SOFTWAREMYTestTest" >
  <RegistryValue Name="COUNTRIES" Value="[COUNTRIES]" Type="string"  />

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


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.


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="SOFTWAREMicrosoftMicrosoft SQL Server 2012 RedistSQL Server System CLR Types1033CurrentVersion"
                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.

链接地址: http://www.djcxy.com/p/61636.html

上一篇: Wix * .msi安装程序图标和徽标

下一篇: WIX安装阅读注册表