[wix-users] Items added as link not found by candle.exe
mrbass21 at gmail.com
Thu Sep 7 21:54:30 PDT 2017
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 18.104.22.1681 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:
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:
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!
More information about the wix-users