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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With