0

After much trouble I have a heat.exe command string that should run and put the files of a folder into a WXS file.

It looks like this

heat dir "$(var.SolutionDir)Web\obj\$(var.MyProject.Configuration)Package" -gg -g1 -cg PACKAGEFILES sreg -dr DEPLOYFOLDER -var "$(var.SolutionDir)Web\obj\$(var.MyProject.Configuration)Package" -out "$(var.SolutionDir)WebInstaller\PackageFragment.wxs"

I used this to get it: http://weblogs.sqlteam.com/mladenp/archive/2010/02/23/WiX-3-Tutorial-Generating-filedirectory-fragments-with-Heat.exe.aspx

However when I try to copy that into my pre-build-event box under "Properties->Build Events" for my WIX project in VS2010 - VS2010 crashes and I cannot load my project until I delete the command directly from the project file xml code.

I now have two questions:

  1. Is this command string correct?
  2. Why does my project crash like that?

Thank you all in advance.

0

1 Answer 1

1

The project crashes because Visual Studio attempts to interpret the $(stuff) as MSBuild properties and gets all confused and crashes.

You'll want to convert that command-line to MSBuild syntax by directly editing the .wixproj file. That way you bypass the parsing code in Visual Studio that crashes. Something like:

<Exec Command='heat dir "..\Web\obj\$(Configuration)Package" -gg -g1 -cg PACKAGEFILES sreg -dr DEPLOYFOLDER -var "..\Web\obj\$(Configuration)Package" -out "..\WebInstaller\PackageFragment.wxs"'

Note: $(var.SolutionDir) is only available when building inside Visual Studio so I recommend not using it (in the example above, I made it a relative path).

Sign up to request clarification or add additional context in comments.

2 Comments

Would it make sense to add a Heat command attribute to the fragment element so it would create itself at compile time?
No because the compile phase doesn't touch the disk today.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.