Accessing TargetDir of a project with WiX preprocessor $var syntax
Asked Answered
D

1

12

I have just started using WiX for the first time.

I added a WiX Votive project to my existing C project.

To automatically select the correct source folder for the binaries add used the following:

<Directory Id="INSTALLLOCATION" Name="Trapeze Capture For Objective" FileSource="$(var.CaptureForObjective.TargetDir)">

That results in the following error:

1>C:\code\CaptureForObjective\Installer\Product.wxs(10,0): error CNDL0150: Undefined preprocessor variable '$(var.CaptureForObjective.TargetDir)'
.

The C project is called CaptureForObjective, and the WiX project is called Installer.

What do I need to do to get this to work?

Disini answered 22/12, 2009 at 22:17 Comment(0)
S
16

In order for the variables to become defined, you must right-click your wix project and add a project reference to your C project . See also this blog post.

Subinfeudate answered 22/12, 2009 at 23:44 Comment(1)
Oh, my god, I wasted so much time. This was it. I have visited every page about the "Undefined preprocessor variable" on the internet.Ailsa

© 2022 - 2024 — McMap. All rights reserved.