WiX将输出包含在一个.msi文件中

时间:2016-08-24 08:21:10

标签: .net wix windows-installer heat

使用此加热命令

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>

构建的输出是这样的: enter image description here

正如您所看到的,.msi包中包含基本文件,但所有DLL都包含在&#39; PFiles&#39;夹。有没有办法将所有DLL包含到.msi包中而不创建文件夹?

由于

1 个答案:

答案 0 :(得分:2)

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

结果如下:

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