问题描述:

I'm trying to add all items in a subfolder using wix and I'm having trouble getting it to work. The folder I'm trying to include is SourceDir\cgis\plugins. I've tried the following command:

heat.exe dir "C:\builds\5\Agile\Enhancements\Sources\cgis\Plugins" -cg "PLUGINS" -gg -dr "INSTALLDIR" -out "C:\builds\5\Agile\Enhancements\Sources\Installer\InstallerFiles\PLUGINSAutoGenerated.wxs"

But the resulting wix file has all the paths set to "SourceDir\Plugins" and doesn't include the "cgis" path. I think it's the "INSTALLDIR" part that's screwing it up. How would I fix this?

Here's the generated wix file...

<?xml version="1.0" encoding="utf-8"?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<Fragment>

<DirectoryRef Id="INSTALLDIR">

<Directory Id="dirFBC2981AD00F77A864B229D586A8FF4A" Name="Plugins" />

</DirectoryRef>

</Fragment>

<Fragment>

<ComponentGroup Id="PLUGINS">

<Component Id="cmp7D6D1821410032777186B326A94B0074" Directory="dirFBC2981AD00F77A864B229D586A8FF4A" Guid="{CB140BBA-A0F1-4DC4-9F52-EC52D37F4FB1}">

<File Id="fil3199D322312FCF2E65220EE1D32E9D01" KeyPath="yes" Source="SourceDir\plugins.xml" />

</Component>

<Component Id="cmp6E9AE677B75D04E674FA3600540B1625" Directory="dir3B79D62CB22DDE06ACABFE4C349DC3D5" Guid="{F51DE300-28E8-4DA6-9E04-B4F889F0A847}">

<File Id="fil1DA820DF22A14405DA2283F347562788" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\config.xml" />

</Component>

<Component Id="cmp8DAD3F1FB1522629C192166C154C3A2A" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{F2D082E5-B1D3-4A84-B526-99547BE0DE3A}">

<File Id="filDB175FB5E01053A10C735912DE80795D" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\config.htm" />

</Component>

<Component Id="cmpC8D27078EA051EC23DCF06532A177C29" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{95CABEFB-3001-4002-8500-333B7934E638}">

<File Id="fil955421CB1EF3331E272E34CF27EC98A3" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\config.js" />

</Component>

<Component Id="cmp6A18228B64852E3965F5B08302B1BFE6" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{6DB30523-AF43-4707-B56B-BA41735B9D80}">

<File Id="fil101FAD959EBBDC663B02415E44CBEA5D" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\editquestion.htm" />

</Component>

<Component Id="cmp7B3C7804DC1AC1264E496AF4C0257472" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{D069AE5A-CFFB-40C3-8FFB-CB182CBB5851}">

<File Id="fil9DDE5D2879BE190C6B522B922923E007" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\Invite.htm" />

</Component>

<Component Id="cmp70098E40BCE6D583D32192EA9D0F27AE" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{E6F526D8-E16D-4908-A9FC-732689156F8E}">

<File Id="fil617D430BB9E459F67655DD2B52A3CEFA" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\manageposition.htm" />

</Component>

<Component Id="cmp560F53E98D173EAD5938035EC67798E4" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{ACF50CF2-06DD-4611-9F43-78F4C85621B5}">

<File Id="fil720812FA3F9F621EB8C2367DA7FB9125" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\present.htm" />

</Component>

<Component Id="cmp71B59D692FE6223BC7A8D71E4F735C3A" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{A0A37806-CBC0-4403-8703-CC2FCB4274A8}">

<File Id="filF660600A71B9A682F7A855C11FB2D8F7" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\present.js" />

</Component>

<Component Id="cmp8C216AE888AE23D9B30C37F00D8F7916" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{C7A2EF9A-62E7-4065-A1F6-717421B7DB4A}">

<File Id="fil8E34957DF91061CB256C47D02702B954" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\results.htm" />

</Component>

<Component Id="cmp89C31F6E30A85F33F4DF1AC88F321152" Directory="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Guid="{9F6F0E18-5F38-474F-8CF6-E674DABB499F}">

<File Id="fil719870ADFE89377CAC14F76531334931" KeyPath="yes" Source="SourceDir\FCE98F84-D42F-4849-ABAC-40B8C0681CCA\Resources\styles.css" />

</Component>

</ComponentGroup>

</Fragment>

<Fragment>

<DirectoryRef Id="dirFBC2981AD00F77A864B229D586A8FF4A">

<Directory Id="dir3B79D62CB22DDE06ACABFE4C349DC3D5" Name="FCE98F84-D42F-4849-ABAC-40B8C0681CCA" />

</DirectoryRef>

</Fragment>

<Fragment>

<DirectoryRef Id="dir3B79D62CB22DDE06ACABFE4C349DC3D5">

<Directory Id="dir3F8AA07072F01F9DE0D4ECCECD604EF4" Name="Resources" />

</DirectoryRef>

</Fragment>

</Wix>

网友答案:

I haven't used this tool in ages, but perhaps try:

heat.exe dir "C:\builds\5\Agile\Enhancements\Sources" -gg -sfrag -out "C:\builds\5\Agile\Enhancements\Sources\Installer\InstallerFiles\PLUGINSAutoGenerated.wxs"

I added the -sfrag to suppress the generation of fragments for directories and components, removed the -cg "PLUGINS" and the -dr "INSTALLDIR" before I finally shortened the input path to stop at "Sources". It is difficult to get this right without experimenting on your actual folder structure, but give it a go.

I believe most people end up using the -var flag: WIX Heat.exe command parameter -var does not accept spaces?

Just for easy access: Harvest Tool (Heat) command line reference.

相关阅读:
Top