WiX不包括收集的文件

时间:2014-06-24 12:21:48

标签: wix

我正在尝试使用WiX为我的项目创建一个安装程序。我的问题是WiX不包括收集的文件。这是我的setup.build的一部分,我在那里收集文件:

<Target Name="Harvest">
<!-- Harvest all content of published result -->
<Exec
Command='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg MyWebWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)'
ContinueOnError="false"
WorkingDirectory="." />
<!-- Where the $(Publish) is my directory, where my files are -->
<!-- And the $(WebSiteContentCode) is 'WebSiteContent.wxs'    -->
</Target>

它收集我的文件(在这个例子中只有一个.txt文件),我得到以下WebSiteContent.wxs:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="INSTALLFOLDER" />
    </Fragment>
    <Fragment>
        <ComponentGroup Id="MyWebWebComponents">
            <Component Id="cmp321CF1B7353E3D6D58B18D7E860682B4" Directory="INSTALLFOLDER" Guid="{32CB89DB-6D10-46B4-B202-7B719766954C}">
                <File Id="fil74269BA21AD1C3ED237BA91C5BD8CA18" KeyPath="yes" Source="$(var.publishDir)\Lofasz.txt" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

在此之后我运行setup.build的以下部分:

<Target Name="WIX">
<!-- At last create an installer -->
    <Exec
    Command='$(WixPath)candle -dpublishDir=$(Publish) -dMyWebResourceDir=. @(WixCode, &apos; &apos;)'
    ContinueOnError="false"
    WorkingDirectory="." />
    <Exec
    Command='$(WixPath)light -ext WixUIExtension.dll -out $(MsiOut) @(WixObject, &apos; &apos;)'
    ContinueOnError="false"
    WorkingDirectory="." />
</Target>

这应该使用收集的文件创建安装程序。 但是当我尝试运行安装程序时,它不包含任何功能。请参见屏幕截图here

感谢您的帮助!

1 个答案:

答案 0 :(得分:2)

我不确定收获是否会创建所有必需的wix条目,只是那些覆盖文件本身的条目。

尝试将以下内容添加到WebSiteContent.wxs

<Feature Id="MyServiceId" Title="My Service Title" Description="My Description" Level="1" Display="expand">
     <ComponentGroupRef Id="MyWebWebComponents"/>
</Feature>