I have authored an installer using Wix 3.6 RC. I have a checkbox in the
dialog UI which is disabled and unchecked initially. There is a "Verify"
button next to it. When I press this button a custom action gets executed
(immediate) and sets a value of parameter which decides whether check box
gets enabled or not. Here is the code:
<Control Id="VirtualCheckBox"
                 Type="CheckBox"
                 CheckBoxValue="1"
                 X="35" Y="100"
                 Width="160" Height="20"
                 Disabled="yes"
                 Text="!(loc.VirtualizationDlg_ChkBox)"
Property="ENABLEVIRTUALIZATION">
  <Condition Action="enable"><![CDATA[INTEGRATED = "1"]]></Condition>
  <Condition Action="disable"><![CDATA[INTEGRATED = "0"]]></Condition>
</Control>

I am storing this value of checkbox in registry:

<Component Id="Virtualization_RegistryEntries" Guid="GUID-IS-HERE">
    <Condition>Not Installed</Condition>
    <RegistryKey Root="HKCU"
                 Key="Software\!(loc.CompanyName)\!(loc.ProductName)">
      <RegistryValue Type="string" Name="Virtualization"
Value="[ENABLEVIRTUALIZATION]" KeyPath="yes"/>
    </RegistryKey>
  </Component>

Now I have to do this:
1) If user does not click the Verify button : Registry gets value 0
2) If he clicks button (CA gets false and checkbox remains disabled) :
Registry gets value 0
3) If he clicks button and checkbox enables but he does not check the
checkbox : Registry gets value 0
4) If he clicks button and checkbox enables and he does check the check box
: Registry gets value 1

Mine is not working at only one condition, when he checks this, registry
does get 1 but either it is disabled or remains unchecked the registry gets
nothing.

Now when I use: <Property Id="ENABLEVIRTUALIZATION" Value="0" />
the check box is checked but remain disabled in UI and registry entry shows
as 0 (great). But now I have a valid Verify button action and checkbox
enables (but still checked). and I go ahead with installation, I saw
registry value still be 0 (oh man!!!) rather it should be 1.

Is there a better way to do this or alternate solution?

-- 
Thanks and Regards,
Ravi Raj
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to