2

I’m writing an MSI for using WiX 3.0 and I’m trying to figure out how to make it include all but some files from a directory without having to manually specify each and every attribute. Similar to a dynamic pickup in installshield.

An old installer I’m looking at for reference (which uses WiX 2.0) does the following:

  1. A makefile to call a script that will copy all the necessary files to a separate directory structure that emulates how the final product should be installed.
  2. another script to insert the attributes for each of the files in this temp folder to a partially completed wxs file.
  3. WiX runs

I want to avoid this step and was wondering if there were some commands or pre-processor directives to achieve this WiX itself?

Also the 1st step above spits out some generated files (from a tool) which is then included into the wxs file. Is there a way I can emulate that as well?

thekbb
  • 7,668
  • 1
  • 36
  • 61
encee
  • 4,544
  • 4
  • 33
  • 35

2 Answers2

7

You need to specify each file.

However, you can use Heat.exe to automatically generate a wxs file you can include as part of your build process.

saschabeaumont
  • 22,080
  • 4
  • 63
  • 85
  • 3
    Is there ANY documentation regarding how to make a typical "create an installer from scratch" scenario? I really like WiX, but the documentation is so...sparse that it is nearly impossible to learn WiX. – Christian Sauer Dec 20 '12 at 08:54
  • @ChristianSauer No not a whole lot of it! Mainly a mix of a few tutorials here and there, and info about Windows Installer. Heat is what you want, you can place it in your .wixproj file in the , output it to a .wxs file and it should be picked up (if the .wxs file already exists, so sketch out a basic one first and add it to the project). – Daniel Morritt Dec 20 '12 at 10:14
  • Doesn't heat generate a component per file? My installer has 1000s of them. – encee Dec 20 '12 at 19:03
  • @royrules22 thousands of components is the correct solution. Open a Visual Studio installer in Orca for example :) – saschabeaumont Jan 25 '13 at 09:47
  • @ChristianSauer see my answer to http://stackoverflow.com/questions/923384/is-there-any-definitive-documentation-on-writing-software-installers/923780#923780 – saschabeaumont Jan 25 '13 at 09:49
0

I cheaped out with a non-solution, and zipped up the directory and it's files in the build script. The advantage of your current method is that MSI is aware of the files and they could potentially be key files (and thus patched/upgraded and/or repaired).

I'd look into saschabeaumont's suggestion about using heat. clearly a better solution

thekbb
  • 7,668
  • 1
  • 36
  • 61