简体   繁体   中英

How to uncheck a CheckBox when a RadioButton is selected

I am dealing with a WiX installer.

I have this CheckBox control:

<Control Type="CheckBox" Id="OfficePluginsEnabledCheckbox" Width="107" Height="17" X="11" Y="114" Text="Enable Installed Add-ins" Property="OFFICEPLUGINSENABLED" CheckBoxValue="1"/>

I have this RadioButtonGroup control:

<Control Type="RadioButtonGroup" Property="INSTALLADDINKEYS" Id="AddinKeysRadioButtonGroup" Width="74" Height="45" X="218" Y="131">
    <RadioButtonGroup Property="INSTALLADDINKEYS">
      <RadioButton Text="All Users" Height="17" Value="AllUsers" Width="200" X="0" Y="0" />
      <RadioButton Text="Current User" Height="17" Value="CurrentUser" Width="200" X="0" Y="15" />
      <RadioButton Text="None" Height="17" Value="None" Width="200" X="0" Y="30" />
    </RadioButtonGroup>
    <Publish Property="OFFICEPLUGINSENABLED"><![CDATA[INSTALLADDINKEYS="None"]]></Publish>
</Control>

I am trying to de-select OfficePluginsEnabledCheckbox when None is ticked in the RadioButtonGroup . As shown above, I've tried publishing the OFFICEPLUGINSENABLED property. However this does not work as OFFICEPLUGINSENABLED is never actually published when None is ticked. Why is this, and how can I achieve my desired functionality?

You are missing a value attribute in your script above. Try the following:

<Publish Property="OFFICEPLUGINSENABLED" Value="0"><![CDATA[INSTALLADDINKEYS="None"]]></Publish>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM