0

I have a checkBox in the wix project UI, when the user check the box, the value is "YES", if not, the value is "NO". I want to write the value of the checkbox to registry key, but no matter whether I set it to "string" or "integer", it always failed:

<Variable Name ="InstallChecked"  Value="YES" bal:Overridable="yes"/>

and

<Component Id="MyFeature" Guid="50f89678-913b-48a9-bb92-b2ad7e97ab03" Win64="yes">
  <RegistryKey Root="HKLM" Key="SOFTWARE\MyDirectory\MyApp">
    <RegistryValue Type="string" Name="MyFeature" Value="[InstallChecked]" KeyPath="yes"/>
  </RegistryKey>
  </Component>

If I set it to "integer", the installation failed on setting the registry, if I set the type to string, after installation, the registry key's value is empty.

beasone
  • 1,073
  • 1
  • 14
  • 32
  • Isn't Variable a Burn element? Does that compile that markup? Or is that top entry from the Burn bundle and the markup beneath from within an MSI? Maybe have a look at [Rob Mensching's Remember Pattern](http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/). – Stein Åsmul Aug 01 '19 at 22:15
  • I think you have to create a MSI property from the bundle variable [like this](https://stackoverflow.com/a/11404594/7571258). – zett42 Aug 04 '19 at 09:52

0 Answers0