Question

Is it possible to include "source" files in a wixlib?

I have a number of c++ solutions, each containing a project or projects, and a wixlib, with a fragment containing entries such as:

<File Id="MY_ID" KeyPath="yes" Source="$(var.my_path)\foo.exe" />

I would like to collect "foo.exe" and include it in the wixlib, then create a WiX project that links together several such wixlibs and produces an MSI.

The reading I have done seems to suggest WiX3 and later supports this, and the technique is preferred to using merge modules.

Currently, I use an environment variable describing the path to the binary files, which gets used by light.exe at the time of linking to locate the files. However, it has the following disadvantages:

  • the version of the files to change between time of compilation of the wixlibs, and linking wixlibs into the MSI, and
  • Being specific to the environment used to build the wixlib (eg: if wixlib compilation and linking happened on different machines, both would need to have built the required binary files)
Was it helpful?

Solution

I don't have much experience with wixlib myself, but isn't it what -bf switch of lit.exe for? From lit.exe help text:

   -bf      bind files into the library file
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top