2016-08-24 39 views
0

使用該熱命令維克斯包括輸出到一個.msi文件

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都包含在'PFiles'文件夾中。有沒有辦法將所有DLL包含到.msi包中,而不是創建文件夾?

感謝

回答

2

只需添加屬性Compressed="yes"Package節點。

下面的結果:

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