默认情况下无法设置第一个单选按钮

时间:2016-12-09 01:48:49

标签: wix

我正在构建一个安装程序,其中包含RadioButtonGroup中的两个单选按钮。我创建了与无线电组相关的属性,并给它一个默认值0(第一个单选按钮)。我还在注册表中查看以前的安装是否设置了其中一个按钮。

<Property Id="MACHINE_TYPE" Value="0" Secure="yes">
        <RegistrySearch Id="ExistingMachineTypeProperty" Root="HKLM" Key="SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Name="AGENT_MACHINE_TYPE" Type="raw" />
</Property>
<SetProperty Action="UpdateMachineTypeValue" Id="MACHINE_TYPE" After="AppSearch" Value="{}">MACHINE_TYPE="0"</SetProperty>

控制元素看起来像这样

<Control Id="DbStatsMachineType" Type="RadioButtonGroup" X="20" Y="78" Width="115" Height="50" Property="MACHINE_TYPE">
    <RadioButtonGroup Property="MACHINE_TYPE">
        <RadioButton Value="0" X="0" Y="0" Width="300" Height="15" Text="Machine A" />
        <RadioButton Value="1" X="0" Y="32" Width="300" Height="15" Text="Machine B" />
    </RadioButtonGroup>
    <Condition Action="enable">DBSTATSENABLED</Condition>
    <Condition Action="disable">NOT DBSTATSENABLED</Condition>
</Control>

我在设置第一个单选按钮时遇到问题。如果没有env var AGENT_MACHINE_TYPE,则默认情况下不会选择单选按钮。如果var等于0,则既不选择单选按钮。但是,如果var为1,则选择第二个单选按钮。我做错了什么?

1 个答案:

答案 0 :(得分:0)

问题与评估条件相对于MACHINE_TYPE初始值的时间有关。

我在处理此问题之前已经发布了答案。 Here,看一看。希望它能帮到你!