WiX:如何根据单选按钮选择更改安装位置?

时间:2012-07-23 10:01:14

标签: wix

我有RadioButtonGroupRadioButtonsAllEasyGateRadioButtonGroup定位的是名为FRAMEWORK的商家。

我想要那个

1.当我点击All时,安装文件夹将变为C:\Program Files (x86)\Arons Medical\

2.当我点击EASY时,安装位置将变为C:\Program Files (x86)\Arons Medical\Easy

3.当我点击GATE时,安装位置将变为C:\Program Files (x86)\GATE

WiX 代码是什么?我猜我必须使用WIXUI_INSTALLDIR属性,但是怎么做?

1 个答案:

答案 0 :(得分:3)

遇到同样的问题并以这种方式解决了:

    <Control Id="RadioButtonGroupID" Type="RadioButtonGroup" X="30" Y="94" Width="305" Height="100" Property="TargetSystem">
      <RadioButtonGroup Property="TargetSystem">
        <RadioButton Value="live" X="0" Y="0" Width="300" Height="10" Text="Live" ToolTip="C:\Live" />
        <RadioButton Value="dev" X="0" Y="20" Width="300" Height="10" Text="Dev" ToolTip="C:\Test" />
        <RadioButton Value="user" X="0" Y="40" Width="300" Height="10" Text="User" />
      </RadioButtonGroup>
    </Control>

    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
      <Publish Property="INSTALLDIR" Value="C:\Test">TargetSystem = "dev"</Publish>
      <Publish Property="INSTALLDIR" Value="C:\Live">TargetSystem = "live"</Publish>
      <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">CostingComplete = 1</Publish>
      <Publish Event="NewDialog" Value="InstallDirDlg">TargetSystem = "user"</Publish>
      <Publish Event="NewDialog" Value="VerifyReadyDlg">
        <![CDATA[TargetSystem <> "user"]]>
      </Publish>
    </Control>

<Property Id="TargetSystem">user</Property>

希望它能帮到你。

电贺 - Xeno