[wix-users] Resolve $(env.) expression when defining compile-time variable

Helge Kruse Helge.Kruse at gmx.net
Sat Jan 21 01:54:26 PST 2017


I author a setup that installs a setup of .NET binaries. Since theses
implement COM classes and the CLSID changes with each compile, it's
necessary to harvest the files with heat after compilation. It's also
possible that files are renamed or added. So it's not possible to stick
with a set of WXS output once created with heat.

The components defined in the .wxs are used in different Setup Projects
(creating MSI files). Therefore I used a XSLT script to change the root
node of the files from <Wix xmlns="..."> to <Include>. In that form I
use <?include?> to get the components in the WXS files of the Setup

The setup shall be compiled on different workstations depending on the
guy how made changes in these binaries, and probably add new file or
rename a file. The path to the files that are used in heat is defined in
workstation defined environment variables. Heat is invoked like this:

heat dir %FOO%\Bin -srd -var var.Files -o FD_Files.wxi -gg -cg cmpFiles
-dr INSTALLFOLDER -t Include.xslt

This requires that candle is called with an option


in each Setup Project. I thinks this is a bot cumbersome when each Setup
Project needs a (long) list of candle options that defines the actual
path to the binaries. So I tried to write a common include file with
compile-time variables defining these paths:

<?xml version="1.0" encoding="utf-8"?>
  <?define Files="$(env.FOO)\bin"?>
  <!-- a lot more -->

Unfortunately the expression $(env.FOO) get literally in the path so
that results in a file-not-found error "$(env.FOO)\bin\hello.dll".

Is there a way to resolve this expression that I write in the include
file? Is there another way to define these path in a centralized
location instead in each Setup Project configuration?

Kind regards

More information about the wix-users mailing list