Nagy Vilmos
Nagy Vilmos

Reputation: 1918

WiX does not include harvested files

I'm trying to use WiX to create an Installer for my project. My problem is that the WiX does not include the harvested files. Here is part from my setup.build, where I harvest the files:

<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>

It harvests my files (in this example only one .txt file), I get the following 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>

After this I run the following part of my 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>

This should create the installer with the harvested files. But when I try to run the installer it does not contain any features. See the screenshot here.

Thanks for your help!

Upvotes: 1

Views: 1277

Answers (1)

Kinexus
Kinexus

Reputation: 12904

I am not sure harvesting will create all the required wix entries, just those that cover the files themselves.

Try adding the following to the WebSiteContent.wxs

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

Upvotes: 3

Related Questions