如何使用间接属性的RadioButtonGroup控件?

时间:2017-04-12 15:41:10

标签: wix windows-installer wix3.10

我正在使用WIX工具集开发一个安装程序,它有一个对话框,它从用户那里获取一些输入并将它们传递给父对话框。对于POC,我为编辑控件做了那个完美的工作。 但是当我使用RadioButtonGroup尝试相同时,它失败了

Unresolved reference to symbol 'Property:_TestRb' in section 'Fragment:'.(LGHT0094)
下面的

是我的父对话框

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI>
            <DialogRef Id="spandlg"></DialogRef>
            <Property Id="TestProp" Value="Test"></Property>
            <Property Id="TestRadio" Value="1"></Property>
            <Dialog Id="parent_dlg" Width="370" Height="270" Title="parent.dlg">
                <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next">
                    <Publish Property="_TestRb" Value="TestRadio" Order="2">1</Publish>
                    <Publish Property="_TestP" Value="TestProp" Order="1">1</Publish>
                    <Publish Event="SpawnDialog" Value="spandlg" Order="3">1</Publish>
                </Control>
                <Control Id="txtBox" Type="Edit" Height="15" Width="321" X="10" Y="16" Property="TestRadio"></Control>
                <Control Id="txtBox1" Type="Edit" Height="15" Width="321" X="10" Y="50" Property="TestProp"></Control>
                <Control Id="c" Type="PushButton" X="300" Y="243" Width="56" Height="17" Default="yes" Text="Cancel">
                    <Publish Event="EndDialog" Value="Exit" Order="2">1</Publish>
                </Control>
            </Dialog>
        </UI>
    </Fragment>
</Wix>

这是一个以Spawn

打开的对话框
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI>
            <Dialog Id="spandlg" Width="370" Height="270" Title="spandlg">
                <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="[Button_Next]">                 
                    <Publish Event="EndDialog" Value="Return"></Publish>
                </Control>
                <Control Id="textBox1" Type="Edit" Height="15" Width="176" X="9" Y="9" Property="_TestP" Indirect="yes" />
                <Control Id="radioButtonGroupBox1" Type="RadioButtonGroup" Height="75" Width="150" X="10" Y="36" 
                         Property="_TestRb" Indirect="yes"  >
                    <RadioButtonGroup Property="_TestRb">
                        <RadioButton X="3" Y="26" Height="18" Width="78" Text="radioButton2" Value="0" />
                        <RadioButton X="3" Y="3" Height="18" Width="78" Text="radioButton1" Value="1" />
                    </RadioButtonGroup>
                </Control>
            </Dialog>
        </UI>
    </Fragment>
</Wix>

我无法解决代码的问题。

2 个答案:

答案 0 :(得分:1)

您应该在某处定义属性。像

这样的东西
<Property Id="_TestRb" />

也许您交换了属性和值属性?

答案 1 :(得分:0)

我能够在删除后解决问题,

<Control Id="txtBox" Type="Edit" Height="15" Width="321" X="10" Y="16" Property="TestRadio"></Control>

来自 parent_dlg 对话框。

看起来,编辑控件可以根据ICE34更改属性 TestRadio 以外的01的值,这些值无效。但错误消息Unresolved reference to symbol 'Property:_TestRb' in section 'Fragment:'根本没用。

定义Property _TestRb 后,显示实际错误ICE34: 1 is not a valid default value for the property TestRadio. The property is an indirect RadioButtonGroup property of control spandlg.radioButtonGroupBox1 (via property _TestRb). (LGHT0204)