Question

We decided to switch from VS integrated setup to WiX.

However, what we currently do is use projects output files as the input for the setup project. This lets us easily add Application Files to a directory (for images, samples, and other resources...) and those files are automatically added to the setup when we build.

I could not find any similar feature in WiX. WiX seems to require one Directory entry and one File entry for each and every directory and file. This would require us to change the WiX source everytime a file is added which, to my eyes, is prohibitive since we have so many of them.

Is there any integrated way of doing that with WiX or do I have to write my own task that will create a WiX source before calling candle?

Was it helpful?

Solution

For WiX 2.0, tallow is very limited; paraffin and mallow offer additional functionality. For WiX 3.0, heat offers the same functionnality as tallow, a little bit better.

In my case I've used mallow source and modified a bit and used it, because paraffin needs 3.5 version of .Net.

You can use Mallow

or Paraffin tool to generate WiX fragments: Getting started, The pain of WiX, A better tallow, Paraffin, Download, Paraffin for WiX 3.0

OTHER TIPS

I've been using heat.exe in WIX 3.5 just for that purpose. Last time I checked though, the documentation wasn't up-to-date with 3.5 release so keep that in mind.

Here is an example:

"$(WIX)bin\heat.exe" dir "$(SourcePath)" -cg MyFiles -gg -scom -sreg -sfrag -dr INSTALLDIR -out "$(ProjectDir)Fragments\FileFragment.wxs" -var wix.InstallerPath

The MapGuide Open Source project is currently using John Robbins' Paraffin 3.0 as others have pointed to.

Basically, the first time through for a given release version, we'll run our installer script with a "generate" action that creates new .wxs files for source folder with specific options for each one.

On subsequent builds of the same version, the "regen" action is called to ensure that the .wxs files are updated with any new files/directories that have been added.

I believe that Heat v3 also now allows you to do a lot (or maybe all?) of this, as Brian Rogers writes . I still feel more comfortable with the way that Paraffin does this more explicitly by maintaining static GUIDs, but the current Heat looks like a good option.

After further research, it seems there is an included binary called tallow.exe that does just that. It creates a fragment from a directory by recursively searching for files.

In my use of WIX, I have never come across a feature that lets you add a whole directory of files at a time. This is because there are many ways a given file can be used (the system doesn't know if you'll later want to refer to a specific file in that folder, etc... and it needs to know them), and also because the install itself needs to be pretty specific.

That doesn't stop you from writing your own frontend for WIX that will generate the WIX XML file (or portions of it) after parsing through a directory structures' contents. That's basically what one of the systems we use at my work does. It's the same idea as any code or text file generation utility. Just traverse through the tree, and generate the appropriate text.

EDIT: In that way, you can consider WIX to be the "low-level language" for defining the setup, and your utility as the "high-level language". If you need help writing one, let us know.

Also, you can have the WIX file be generated as part of the build process by adding this utility to the custom build steps in VStudio. That way you don't actually have a "saved WIX file" that anyone builds, the system just builds it at the end, automatically taking new files into account at the post-build step.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top