[wix-users] Items added as link not found by candle.exe

Blair Murri osito at live.com
Sat Sep 9 22:38:04 PDT 2017

The search paths are only used for locating files identified in <?include ?> processing instructions (WXI files). It isn't used to locate source files (WXS). If a source file where linked in, its path would have been passed to Candle and you wouldn't have noticed any issue.

Content files (your WXI) are used for incremental build determinations, but are not passed to Candle itself. A useful proposal might be to calculate include paths (from linked files) and pass the directories. Please consider opening such a proposal.

I can see why variables in the search path property could be desirable. I can also see why it wouldn't work. You could consider opening an issue for MSBuild properties to be processed in search paths when calling Candle via MSBuild/VisualStudio. For almost all use cases, however, I would recommend using relative paths.

Blair Murri

Sent from my Windows 10 phone

From: Jason Beck via wix-users<mailto:wix-users at lists.wixtoolset.org>
Sent: Thursday, September 7, 2017 9:54 PM
To: wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>
Cc: Jason Beck<mailto:mrbass21 at gmail.com>
Subject: [wix-users] Items added as link not found by candle.exe

I apologize if this has been answered before, or if I'm doing it wrong,
but I've run into a weird issue and I'd like a cleaner way of doing it,
or an understanding of why I'm having this problem. I'm also newer to WiX.

I'm using WiX and Visual Studio 2012.

The basic setup is that my company has three WiX projects for three
products that share some components, but are different. The WiX projects
are kind of a mess and I've been going through the 3.6 WiX book trying
to clean things up. The first thing I want to do is add a "Common.wxi"
include file that has all the UpgradeCodes and other properties the
projects share to each project. I want changes that are made to this
file to be made to all other projects too, so I need to add it as a
link. This seems like a pretty easy setup.

The Common.wxi file is in another directory (I.E. not in the WiX project
directories). I add an existing item to one of the WiX projects, then
select the drop down for "add as link". I then have the line:

<?include Common.wxi?>

at the top of my Product.wxs (inside the Wix tag) file for that project.

When I compile, I get an error: error CNDL0103: The system cannot find
the file 'Common.wxi' with type 'include'.

If I open the wixproj file, I see the following section:

  <Content Include="..\..\..\..\common\windows\WiX\Common.wxi">

I don't know why WiX isn't resolving it automatically. I then tried to
add a folder to the property sheet Paths section. There's no labeling or
instructions for this property sheet, so I had to guess a little. When I
add it to the bottom section I saw it showing up in the candle.exe
output, and it had the -I flag, so I assume it's the correct one, but it
seems that items in this property sheet won't evaluate the variables in
it. Adding: $(SolutionDir)..\..\common\windows\WiX\ to that path
resulted in candle output (obviously truncated):

... -I"$(SolutionDir)..\..\common\windows\WiX\\" ...

This is obviously wrong.

If I go and paste that exact line into the Compiler Additional
Parameters section of the Tool Settings property sheet, everything
works. Common.wxi is found and included, the variable on the candle call
is evaluated and -I has the correct path.

I can also put in a relative path into the Path property sheet (without
any variables) and this works as well.

Further, how would I handle splitting components into fragment wxs files
in another directory? Will the -I flag also trigger candle to look for
wxs files? Will Candle actually reference the add as link location?

Again, it seems really strange that I have to include any paths at all
since the wixproj file has the path to my include file already, but I
just may have a lack of understanding of the way WiX building works.

Thanks for the time!

WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

More information about the wix-users mailing list