[QBS] Fwd: Function to enumerate all files in desired directory

Denis Shienkov denis.shienkov at gmail.com
Wed Jun 4 15:40:27 CEST 2014

Hi guys.

I have a trouble using the "heat.exe" utility to generate an *.wxs file.

I got an error:

generating myfiles.wxs

C:\Program Files\WiX Toolset v3.8\bin/heat.exe dir . -cg MyProjectFiles -gg
-scom -sreg -sfrag -srd -dr INSTALLLOCATION -var env.MyProjectFilesDir
-template fragment -out myfiles.wxs

heat.exe : error HEAT0319 : The '-out' or '-o' parameter must specify a
file path.

Process failed with exit code 319.


but same command line perfectly works from the "cmd.exe" if I run it

Even when I cut the command line up to: "C:\Program Files\WiX Toolset
v3.8\bin/heat.exe dir . -out myfiles.wxs" then I got same error...

The source code of my Rule:

Rule {

        id: heater

        inputs: [ "xslt" ]

        Artifact {

            fileTags: [ "wxs" ]

            fileName: product.destinationDirectory + "/myfiles.wxs"


        prepare: {

            var args = [];

            args.push("dir .");

            args.push("-cg MyProjectFiles");






            args.push("-dr INSTALLLOCATION");

            args.push("-var env.MyProjectFilesDir");

            args.push("-template fragment");

            args.push("-out " + FileInfo.fileName(output.fileName));

            var cmd = new Command("heat.exe", args);

            cmd.description = "generating " +

            cmd.highlight = "generator";

            cmd.workingDirectory = FileInfo.path(output.fileName);

            return cmd;



UPD: If I to do replacing an arguments to one line:

args.push("dir . -cg MyProjectFiles -gg -scom -sreg -sfrag -srd -dr
INSTALLLOCATION -var env.MyProjectFilesDir -template fragment -out " +

then I got another error:

generating mtrfiles.wxs

C:\Program Files\WiX Toolset v3.8\bin/heat.exe dir . -cg MyProjectFiles -gg
-scom -sreg -sfrag -srd -dr INSTALLLOCATION -var env.MyProjectFilesDir
-template fragment -out myfiles.wxs

heat.exe : error HEAT0318 : A harvest source must be specified after the
harvest type and can be followed by harvester arguments.

Process failed with exit code 318.


I found a similary problem in Google:
but those recommendations (with quoted the paths) do not helps..

Guys, what is strange error? :(


2014-06-03 11:08 GMT+04:00 Denis Shienkov <denis.shienkov at gmail.com>:

> Guys, many thanks for yours help.
> BR,
> Denis
> 2014-06-02 19:34 GMT+04:00 Jake Petroules <jake.petroules at petroules.com>:
> On 2014-06-02, at 11:12 AM, <Johannes.Matokic at microchip.com> <
>> Johannes.Matokic at microchip.com> wrote:
>> Hi Denis,
>> If you only need the files for use with WiX there might be a workaround.
>> WiX provides the tool head.exe which can create wxs files with a
>> component containing all files found in one directory.
>> This tool could be easily used in special rule or transform which
>> requires only one file as the root of the directory structure as input.
>> This rule would then call “heat.exe dir sourceDir -out output.wxs” with
>> extra arguments as required and would produce output.wxs which when tagged
>> as “wxs” should be used by the wix module like any normal wxs-file.
>> You then don’t have a list of all files inside qbs but they will still be
>> included in the installer.
>> However I don’t think that heat is able to filter for specific files. You
>> have to make sure that only the files you really want are inside the
>> directory.
>> Best Regards,
>> Johannes
>> _______________________________________________
>> QBS mailing list
>> QBS at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qbs
>> This is a good point. The task for implementing WiX support in Qbs
>> (QBS-413) is still incomplete; there's a lot of functionality to add and it
>> will be a while before I'll be able to get to it all. heat is the perfect
>> tool for a 'WixFileCollection' product type or something of the sort.
>> Perhaps it could even collect output artifacts of dependent products
>> allowing for a clean, smooth way of getting your EXEs and DLLs into your
>> MSI.
>> --
>> Jake Petroules - jake.petroules at petroules.com
>> Chief Technology Officer - Petroules Corporation
>> _______________________________________________
>> QBS mailing list
>> QBS at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20140604/7b7ceb6a/attachment.html>

More information about the Qbs mailing list