WIX Combobox填充值

时间:2013-06-10 02:19:48

标签: wix wix3.7

有没有人知道如何使用WIX Setup.AS将值填充到组合框中我正在尝试过去几周。我无法实现这一点,当尝试执行我的MSI时,组合框没有出现.Below提供我正在做的事情请帮助我。

             

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

    <Feature Id="ProductFeature" Title="SetupProjectComboTest" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>

<UI>
  <UIRef Id="WixUI_FeatureTree" />
  <ComboBox Property="WIX_VERSIONS">
    <ListItem Value="Windows Installer XML 3.0" />
    <ListItem Value="Windows Installer XML 3.5" />
    <ListItem Value="Windows Installer XML 3.6" />
  </ComboBox>
  <Dialog Id="MyCustomDlg"  Width="500" Height="260">
    <Control Id="ComboBoxMain" Type="ComboBox" X="10" Y="60" Width="300" Height="17" Property="WIX_VERSIONS" />
    <Control Id="ButtonMain" Type="PushButton" X="320" Y="60" Width="40" Height="17" Text="Show">
      <Publish Property="COMBOVALUEFORMATTED" Order="1"  Value="You've chosen the [WIX_VERSIONS] version of the toolset" />
    </Control>
    <Control Id="LabelMain" Type="Text" X="10" Y="80" Width="360" Height="17" Property="COMBOVALUEFORMATTED" Text="[COMBOVALUEFORMATTED]" />

  </Dialog>
</UI>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="SetupProjectComboTest" />
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
        <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
        <!-- <Component Id="ProductComponent"> -->
            <!-- TODO: Insert files, registry keys, and other resources here. -->
        <!-- </Component> -->
    </ComponentGroup>
</Fragment>

1 个答案:

答案 0 :(得分:5)

试试这个解决方案:

<Control Id="ComboBoxMain" Type="ComboBox" X="10" Y="60" Width="300" Height="17" Property="WIX_VERSIONS" >
    <ComboBox Property="WIX_VERSIONS">
        <ListItem Value="Windows Installer XML 3.0" />
        <ListItem Value="Windows Installer XML 3.5" />
        <ListItem Value="Windows Installer XML 3.6" />
    </ComboBox>
</Control>