我正在尝试安装 SelectedTree 上的组件将取决于属性值。因此,我使用绑定到属性的 Edit 组件创建了自己的 UI 对话框。
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="WixUI_ProductType">
<PropertyRef Id="PRODUCTKEY" />
<Dialog Id="ProductChooseDlg" Width="370" Height="270" Title="Product key">
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Specify your product" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Product code" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Control_Label" Type="Text" X="20" Y="100" Width="105" Height="30" NoPrefix="yes" Text="Please enter your code:" />
<Control Id="Control_Edit" Type="Edit" X="125" Y="98" Width="50" Height="16" Property="PRODUCTKEY"/>
<Control Id="Next" Type="PushButton" X="241" Y="243" Width="60" Height="17" Text="Next">
<Publish Event="NewDialog" Value="CustomizeDlg" Order="1"></Publish>
<Publish Property="PRODUCTKEY" Value="NE05" Order="2"></Publish>
<Condition Action="disable"><![CDATA[PRODUCTKEY = "ALL"]]></Condition>
<Condition Action="enable"><![CDATA[PRODUCTKEY <> "ALL"]]></Condition>
</Control>
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="60" Height="17" Text="Back">
<Publish Event="NewDialog" Value="WelcomeDlg"></Publish>
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
但问题是当更改值 SelectedTree 时不会更新自己。我总是有相同的选择列表。功能有自己的条件来检查属性值。
<Feature Id='FeatureExportModule' Title='Export module' Description='' Level='0'>
<ComponentRef Id='ComponentDataMigration.Modules.Export' />
<Condition Level='1'><![CDATA[PRODUCTKEY = "EXPO"]]></Condition>
</Feature>
只有当我在 xml 中手动设置值时它才有效。如何解决?
<Property Id="PRODUCTKEY" Value="EXPO"/>