How to add a whole directory or project output to WiX package

…衆ロ難τιáo~ 提交于 2019-11-28 16:19:23
sundar venugopal

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!