【问题标题】:WiX includes output into one .msi fileWiX 将输出包含在一个 .msi 文件中
【发布时间】:2016-08-24 08:21:09
【问题描述】:

使用这个加热命令

heat dir "$(SolutionDir)scr\A\A.WindowsService\bin\$(Configuration)" -t "$(SolutionDir)scr\Installers\A\AInstallerHeat\Filter.xsl" -var wix.Path -dr ConfigurationUtilityDir -gg -g1 -cg ConfigurationUtilityComponents -xo -srd -out "$(SolutionDir)scr\Installers\A\AInstallerHeat\ConfigurationUtilityHeat.wxs"

Product.wxs 文件的配置

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Product Id="*" Name="AInstallerHeat" Language="1033" Version="1.0.0.0" Manufacturer="B" UpgradeCode="c1e6c1f6-69a5-4f01-92d0-1c4cb60ee3bc">
    <Package InstallerVersion="200"  InstallScope="perMachine" />

    ...
    <MediaTemplate EmbedCab="yes" />
    <!-- Condition Properties -->
    <Property Id="Privileged" Value="1" />
    ...

    <Feature Id="ProductFeature" Title="AInstallerHeat" Level="1">
      <ComponentGroupRef Id='ConfigurationUtilityComponents' />
      <ComponentRef Id='CMP_AWindowsService' />
    </Feature>

    <Directory Id="TARGETDIR" Name="SourceDir">
      ...
          <Directory Id="ConfigurationUtilityDir" Name="A">
            <!-- Bin folder -->
            <Directory Id="BINDIR" Name="bin"/>
          ...
    </Directory>
  </Product>

  <!-- A Windows Service -->
  <Fragment>
    <DirectoryRef Id="BINDIR">

      <Component Id="CMP_AWindowsService"
                 Guid="3D3DE5C1-7154-4c61-9816-248A85F6DEBF"
                 KeyPath='no'>

        <File Id="A.WindowsService.exe"
              Name="A.WindowsService.exe"
              KeyPath="yes"
              Vital="yes"
              Source="$(var.SolutionDir)\scr\A\A.WindowsService\bin\$(var.Configuration)\bin\A.WindowsService.exe"
              ReadOnly='no'
              Compressed='yes'
              Hidden='no'
              System='no'
              Checksum='no'/>  

...
   ...
      </Component>
    </DirectoryRef>
  </Fragment>
</Wix>

构建的输出是这样的:

如您所见,.msi 包包含基本文件,但所有 DLL 都包含在“PFiles”文件夹中。有没有办法将所有 DLL 包含到 .msi 包中而不创建文件夹?

谢谢

【问题讨论】:

    标签: .net wix windows-installer heat


    【解决方案1】:

    只需将属性Compressed="yes" 添加到Package 节点即可。

    结果如下:

    <Package InstallerVersion="200" InstallScope="perMachine" Compressed="yes" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多