如何在选择RadioButton时取消选中CheckBox

时间:2015-04-24 19:33:34

标签: .net xml checkbox wix installer

我正在处理WiX安装程序。

我有CheckBox控件:

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

我有RadioButtonGroup控件:

<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>

我想在OfficePluginsEnabledCheckbox中勾选None时取消选择RadioButtonGroup。如上所示,我尝试发布OFFICEPLUGINSENABLED属性。但是,这不起作用,因为勾选OFFICEPLUGINSENABLEDNone实际上从未发布。为什么会这样,我怎样才能实现我想要的功能呢?

1 个答案:

答案 0 :(得分:0)

您在上面的脚本中缺少值属性。请尝试以下方法:

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