Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing TargetDir of a project with WiX preprocessor $var syntax

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?

like image 317
Leith Bade Avatar asked Dec 22 '09 22:12

Leith Bade


People also ask

How do you declare a preprocessor variable in WiX?

PRO TIP: Preprocessor variables in WiX can be declared in a number of ways, but the most common method is to use the define element. This element takes two attributes, name and value. The name attribute is the name of the variable, and the value attribute is the value that will be substituted for the variable.

What is TargetDIR WiX?

TargetDIR is the directory in which the files are installed. It is a required parameter for the element. The value of TargetDIR is resolved to an absolute path during installation. If TargetDIR is not specified, the default is the directory of the component.

What is product WXS file?

Source file created by Windows Installer XML (WiX) toolset, a Windows installer developing program; XML document containing one root element (<Wix>); a collection of strings for localizing a product into a specific culture; similar to . CPP files.


1 Answers

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.

like image 121
Wim Coenen Avatar answered Nov 07 '22 17:11

Wim Coenen