title: WIX: Setting a registry value from a dialog checkbox
body: <p>Using Wix for the first time in 10+ years, and first time with forms/dialog entry.</p>
  <p>Have a property defined more or less like this:</p>
  <pre><code>&lt;Property Id=&quot;THE_FLAG&quot;&gt;
    &lt;RegistrySearch Id=&quot;SearchTheFlag&quot;  Root=&quot;HKLM&quot; Key=&quot;SOFTWARE\$(var.Manufacturer)\$(var.SimpleProductName)&quot; Name=&quot;the_flag&quot;  Win64=&quot;$(var.Win64)&quot; Type=&quot;raw&quot; /&gt;
  &lt;/Property&gt;
  </code></pre>
  <p>Have a control in a form to set it:</p>
  <pre><code>&lt;Control Id=&quot;TheFlagCheckBox&quot; Type=&quot;CheckBox&quot; X=&quot;45&quot; Y=&quot;80&quot; Width=&quot;220&quot; Height=&quot;17&quot; Property=&quot;THE_FLAG&quot; CheckBoxValue=&quot;1&quot; Text=&quot;Flag for something&quot; /&gt;
  </code></pre>
  <p>At the end I want to write it:</p>
  <pre><code>&lt;RegistryKey Root='HKLM' Key='SOFTWARE\$(var.Manufacturer)\$(var.SimpleProductName)' ForceCreateOnInstall='yes' &gt;
      &lt;RegistryValue Name='the_flag'     Type ='integer' Value='[THE_FLAG]' /&gt;
  &lt;/RegistryKey&gt;
  </code></pre>
  <p>If I select the checkbox, it sets the registry value. However, if I don't check the checkbox, then I get a warning when running the installer about not being able to acces the registry value. I think it is because the &quot;value&quot; of &quot;THE_FLAG&quot; is null or the empty string. I want to avoid the nasty warning to the user. I took over some code, and the previous owner used all strings for obviously DWORD values...maybe to get around the warning.</p>
  <p>Can I set some conditionals or set the value of THE_FLAG to &quot;0&quot; if it is &quot;&quot; or null?</p>