2

I have a project that has a large number of files. Between versions of our software, new files get added and some get removed. Therefore, in automating our build process, I would like to have heat auto-generate a .wxs file (let's call it files.wxs).

But then there are certain hand-generated items, like the <product> element with its associated version and <environment> tags for environment variables that we need to set. These never change (except for the version number which increments). Right now, I have put all of that in a file named product.wxs.

How can I best combine them into one .msi? Do I need to create a <component> element inside the <product> element for each of the fragments that were auto-generated in the files.wxs file? If so, that kind of defeats the purpose of auto-generating that file. I'm hoping there is another way.

Help! Thanks, in advance.

Quentin
  • 62,093
  • 7
  • 131
  • 191
Eric
  • 1,414
  • 3
  • 16
  • 35

1 Answers1

2

The installer that I work on has both manual and heat generated code how ours handle it is:

A script builds the destination file structure i.e. all the files that will be installed are copied to a temp directory mimicking the structure they will have on destination machine

Heat.exe is then executed on that directory structure outputting to a file.

We then apply some transforms as we have multiple features in our installer (though if your installer is just one feature you could use a singular ComponentGroup created by Heat.exe), the transform groups the components into ComponentGroups based off the directory structure.

The manual files only reference the ComponentGroups.

If a file is added or removed the work is done on the script (if necessary, parts of script just scoop whole directories). When the installer is built a new component is automatically generated for that file and it's added to the appropriate group by the transform. No work is needed as that group is already referenced in the manual files.

Rick Bowerman
  • 1,866
  • 12
  • 12
  • Thanks, Rick! That definitely got me farther. But now I'm getting Guid generation issues because my ComponentGroup is not rooted under "ProgramFilesFolder" - but the generated .wxs file points everything to "SourceDir". I'm running into my lack of understanding of how Directories work. In my mind, there are 2 concepts: source directories (where I'm getting files from) and destination directories (where will they go when they are installed. But in the .wxs file, I just specify < Directory > tags, and they seem to serve both functions: I've got a "ProgramFilesFolder" under a "SourceDir". – Eric Jul 09 '14 at 23:36
  • I decided this was enough of a different question that I posted it separately [here](http://stackoverflow.com/questions/24665555/wix-how-to-allow-autogenerated-componentgroup-to-autogenerate-guids). – Eric Jul 10 '14 at 00:05