[wix-users] Invalid DefaultDir when running light in WiX

Rob Mensching rob at firegiant.com
Tue Aug 9 12:48:44 PDT 2016

FYI: That isn't an official distribution of the WiX Toolset.

 Short replies here. Complete answers over there: http://www.firegiant.com/

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of George Mauer
Sent: Tuesday, August 9, 2016 12:45 PM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Invalid DefaultDir when running light in WiX

This is cross-posted to StackOverflow
to do that, but it feels like I'm so close and under a time crunch.

I simply want to do an installer that will move some files into Program Files, set up a start menu link, and appear in the add/remove program to be uninstalled. For the time being I'm happy to punt on the start-menu link as that seems relatively straight forward

The caveat is that I specifically want this to be build-able from a script
*without* any sort of global installs. That means no Visual Studio extension nor any global installation of the WiX toolkit.

I was able to find WiX on nuget
<https://www.nuget.org/packages/WiX/> which seems to come with all the correct executables packaged. So I would like to use these. I set up aliases for candle, light, and heat to draw from the tools/directory.

To start with, I create a very simple file structure that I want moved into Program Files/Foo

  |- bar.txt
  |- one.txt
  |- afolder/
     |- baz.txt

I also use a WixSample project and some recommendations <http://stackoverflow.com/questions/38795093/how-to-include-the-output-of-heat-in-a-wix-file-no-visual-studio-project/38799280#38799280>
create the following /temp/foo.wxs:

<?xml version="1.0" encoding="UTF-8"?><Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
    <!-- Use * to generate product ID on every build -->
    <Product Id="*" Language="1033" Manufacturer="gim" Name="Foo Sample" UpgradeCode="1750d746-841f-4a27-a0ba-661b093dac23"
        <Package Comments="comments!" Compressed="yes"
Description="Attempting to learn Wix" InstallScope="perMachine"
        <MediaTemplate EmbedCab="yes"/>
        <!--Directory structure-->
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="DYNAMIC" Name="Dynamic"/>
        <Feature Id="AllOfTheFiles">
            <ComponentGroupRef Id="CMPG_AllOfTheFiles"/>

I then run

temp> heat dir W:\temp\SourceDir\ -cg CMPG_AllOfTheFiles -ke -dr
DYNAMIC -gg -sfrag -o .\Dynamic.wxs

Which generates Dynamic.wxs

<?xml version="1.0" encoding="utf-8"?><Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
        <DirectoryRef Id="DYNAMIC">
            <Directory Id="dirGQx5YQf5IXUdDl9BwSUIwBDODsQ" Name="SourceDir">
                <Component Id="cmpGDFXrG8sOAaKgy928OXqQ2tfoYI"
                    <File Id="fil9Q22BRrI_M6KyGIXyzknyYKsXYM"
KeyPath="yes" Source="SourceDir\bar.txt" />
                <Component Id="cmpiuJCUGMxrseFgAzuyEWugfL6co0"
                    <File Id="filJdeJM1_v6rytDwKRYjkJ6S4Ukos"
KeyPath="yes" Source="SourceDir\one.txt" />
                <Directory Id="dir1V3jm.snhkr1aYM.1IgU9rhSuSM" Name="afolder">
                    <Component Id="cmpnBgBnytwthO6y_QeTGG7n0P_cSw"
                        <File Id="filDNjPHE_Pp2VbCtvIxLyegx_2prU"
KeyPath="yes" Source="SourceDir\afolder\baz.txt" />
        <ComponentGroup Id="CMPG_AllOfTheFiles">
            <ComponentRef Id="cmpGDFXrG8sOAaKgy928OXqQ2tfoYI" />
            <ComponentRef Id="cmpiuJCUGMxrseFgAzuyEWugfL6co0" />
            <ComponentRef Id="cmpnBgBnytwthO6y_QeTGG7n0P_cSw" />

I then run

temp> candle .\foo.wxs
temp> candle .\Dynamic.wxs

Which generates a wixobj for each.

Finally I try to light these.

temp> light .\foo.wixobj .\Dynamic.wixobj -o .\foo.msi -nologo
W:\temp\Dynamic.wxs(5) : error LGHT0204 : ICE03: Invalid DefaultDir string; Table: Directory, Column: DefaultDir, Key(s):

At this point I'm stumped. I have no idea what this error means nor how to fix it - why is that directory causing issue?

More information about the wix-users mailing list