Search code examples
wix

Why build time when referencing wixlib project doubles?


I have a large number of msi projects that use the same files. The file references have been explicitly defined in each project. I have created a wixlib project with heat harvesting of the files, removed the explicit references from the msi projects and referenced the wixlib project.

Everything works fine apart from build time which is doubled for each msi project.

From the build logs, I can see that the wixlib project was built once.

Every Light.exe -wixprojectfile MyProject.wixproj obj\Release\Product.wixobj MyInstallerLib.wixlib takes now twice as long to build.

I understand that the first project will take longer, wixlib needs to be built.

Why does referencing a wixlib, that performs heat task once and packs the content into the obj\Release\Product.wixobj, take twice as long for each project?


Solution

  • You don't specify, but I'm guessing that you are binding the files into the .wixlib. Doing so makes the .wixlib "portable" (easy to send to other places) because the referenced files are compressed in the .wixlib.

    However, the portability comes with a cost. When consuming the .wixlib, the files must be decompressed so they can be included in the final output.

    So my hypothesis is that you are:

    1. Binding files into the .wixlib (compressing)
    2. Consuming the .wixlib in project 1 (decompressing)
    3. Consuming the .wixlib in project 2 (decompressing, again)

    If you are building everything on the same machine then you can not bind the files into the .wixlib so the .wixlib contains pre-compiled references to the files on disk bypassing all the extra compression and decompression.