C# 如何在wix工具集中找到BrowseDlg?

C# 如何在wix工具集中找到BrowseDlg?,c#,visual-studio,wix,C#,Visual Studio,Wix,我有一个程序与一个工作的安装程序,虽然我想添加一个窗口浏览文件,并选择一个加上添加到应用程序的参考,我想要一个你可以浏览到一个文件位置。我看到有一个BrowseDlg,但我不知道如何在Wix中访问它?我不知道从哪里开始控制预先设计的BrowserDlg <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <?if $(var.

我有一个程序与一个工作的安装程序,虽然我想添加一个窗口浏览文件,并选择一个加上添加到应用程序的参考,我想要一个你可以浏览到一个文件位置。我看到有一个BrowseDlg,但我不知道如何在Wix中访问它?我不知道从哪里开始控制预先设计的BrowserDlg

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <?if $(var.Platform)=x64 ?>
  <?define ProductCode = "{A22947AF-0624-462F-91D7-042FBA975C74}" ?>
  <?else?>
  <?define ProductCode = "{4D5A783C-22C5-4D71-BA70-1AC08C70755D}" ?>
  <?endif?>

  <?define UpgradeCode = "{8F393562-E837-4F24-A53D-4E4D580915BC}" ?>
  <?define BuildVersion = 1.2.3.4?>

  <Product Id="$(var.ProductCode)" 
      Name="!(loc.ProductName_$(var.Platform))" 
      Language="!(loc.Language)" 
      Version="$(var.BuildVersion)" 
      Manufacturer="!(loc.Company)" 
      UpgradeCode="$(var.UpgradeCode)">

    <Package 
      InstallerVersion="200" 
      Compressed="yes" 
      InstallScope="perMachine" 
      Platform="$(var.Platform)"
      Manufacturer="!(loc.Company)"
      Description="!(loc.Description)"
      Keywords="!(loc.Keywords)"
      Comments="!(loc.Comments)"
      Languages="!(loc.Language)"
      />
        <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" />
        <MediaTemplate 
      EmbedCab="yes" 
     />

    <Icon Id="icon.ico" SourceFile="$(var.app.ProjectDir)\app.ico"/>

    <Property Id="ARPPRODUCTICON">icon.ico</Property>
    <Property Id="ARPURLINFOABOUT">!(loc.helpLink)</Property>
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />

    <UIRef Id="WixUI_Mondo"/>
    <UIRef Id="WixUI_ErrorProgressText" />

    <WixVariable Id="WixUIDialogBmp" Value="$(var.ProjectDir)\Assets\IconBanner.bmp"/>
    <WixVariable Id="WixUIBannerBmp" Value="$(var.ProjectDir)\Assets\Banner.bmp"/>
    <WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\Assets\License.rtf"/>

        <Feature Id="ProductFeature" Title="appname" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
            <ComponentGroupRef Id="PublishedComponents" />
        </Feature>
    </Product>
</Wix>

icon.ico
!(地址:helpLink)

看看定制LG是如何使用WiX源中的BrowseDlg的


1.
安装
安装
基本上,您需要使用并使用_BrowseProperty共享数据

我应该注意,这只能用于选择文件夹而不是文件。要做到这一点,需要使用MSI之外的自定义UI工作。这是非常高级的东西,所以将其推迟到应用程序第一次运行而不是安装程序可能会更容易、更好

 <Dialog Id="CustomizeDlg" Width="370" Height="270" Title="!(loc.CustomizeDlg_Title)" TrackDiskSpace="yes">
                <Control Id="Tree" Type="SelectionTree" X="25" Y="85" Width="175" Height="115" Property="_BrowseProperty" Sunken="yes" TabSkip="no" Text="!(loc.CustomizeDlgTree)" />
                <Control Id="Browse" Type="PushButton" X="294" Y="210" Width="66" Height="17" Text="!(loc.CustomizeDlgBrowse)">
                    <Publish Event="SelectionBrowse" Value="BrowseDlg">1</Publish>
                    <Condition Action="hide">Installed</Condition>
                    <Condition Action="disable">Installed</Condition>
                </Control>