2

有没有人知道如何使用 WIX Setup.AS 将值填充到组合框中我。

    <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>

4

1 回答 1

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>
于 2013-10-31T10:45:05.630 回答