Tag Archives: bug

[EN] Windows Installer XML – Heat bug?

I was trying to write a post on generating wxs scripts with heat. But i think I found a bug. Below more info ? maybe someone can verify.

I?ve got a following directory contents:

image

And I run heat with following parameters:

heat dir . -dr D_INSTALLLOCATION -sfrag -srd -gg -suid -cg test -out test.wxs

I get following wxs:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <ComponentGroup Id="test">
            <ComponentRef Id="" />
            <ComponentRef Id="" />
            <ComponentRef Id="" />
            <ComponentRef Id="" />
        </ComponentGroup>
    </Fragment>
    <Fragment>
        <DirectoryRef Id="D_INSTALLLOCATION">
            <Component Id="c2csi.exe" Guid="{43B03251-B0EE-4273-8E3C-DE54EAD0A263}">
                <File Id="c2csi.exe" KeyPath="yes" Source="SourceDir\c2csi.exe" />
            </Component>
            <Component Id="c2csi.pdb" Guid="{5B925509-EB62-461F-BEB8-FC4C8C99C290}">
                <File Id="c2csi.pdb" KeyPath="yes" Source="SourceDir\c2csi.pdb" />
            </Component>
            <Component Id="c2csi.vshost.exe" Guid="{048CE65A-FCD9-4A05-B482-45F326F40199}">
                <File Id="c2csi.vshost.exe" KeyPath="yes" Source="SourceDir\c2csi.vshost.exe" />
            </Component>
            <Component Id="test.wxs" Guid="{90927E13-B1AD-48D2-AADA-0C227CD2DC36}">
                <File Id="test.wxs" KeyPath="yes" Source="SourceDir\test.wxs" />
            </Component>
        </DirectoryRef>
    </Fragment>
</Wix>

Notice the ComponentGroup ? it has empty Ids in ComponentRef.

Why would I want to generate non unique File Ids and put them in ComponentGroup?

The answer is: I would put ComponentGroupRef in Feature and use references to File element to create for example a shortcut in start menu.

Now when I removed ?suid when calling heat it generated wxs with unique component and file ids which are impossible to reference in the main script.

Is it a bug or should I take a completly different approach?

UPDATE: when used project harvester with the same paramaters .wxs was ok:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="c2csi.Binaries">
            <Component Id="c2csi.Binaries.c2csi.exe" Guid="{22D0EAD2-B33C-4D1D-B5F2-FA046CF79649}">
                <File Id="c2csi.Binaries.c2csi.exe" Source="$(var.c2csi.TargetDir)\c2csi.exe" />
            </Component>
        </DirectoryRef>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="c2csi.Binaries">
            <ComponentRef Id="c2csi.Binaries.c2csi.exe" />
        </ComponentGroup>
    </Fragment>
</Wix>
Tagged , , ,