Discussion:
[WiX-users] Heat.exe
David Amey
2010-09-22 22:11:10 UTC
Permalink
Hi everyone!

I've been struggling with this problem for a while, if anyone can help I would really appreciate it.

Basically I'm using heat to harvest a folder, simples. However I'm using the "-var" property in the command line (to replace the "sourceDir" in the output component's source attribute), using a variable declared in the main.wxs. This replaces the "sourceDir" as expected, but when it comes to candle to compile , it flags an error as if the variable isn't populated.

Sorry if this was hard to follow or understand (incredibly frustrated!), but if you think you can help I will try and explain a bit better.

Thanks in advance!

David Amey
Technical Developer
Bob Arnson
2010-09-23 00:32:24 UTC
Permalink
Post by David Amey
Basically I'm using heat to harvest a folder, simples. However I'm using the "-var" property in the command line (to replace the "sourceDir" in the output component's source attribute), using a variable declared in the main.wxs. This replaces the "sourceDir" as expected, but when it comes to candle to compile , it flags an error as if the variable isn't populated.
You have to define the values for any preprocessor variables you use in
your source code. How you do that depends on how you run the compiler
(e.g., -d on the command line or DefineConstants in MSBuild) but both
are documented in WiX.chm.
--
sig://boB
http://joyofsetup.com/
David Amey
2010-09-23 09:26:35 UTC
Permalink
Thankyou Bob,

This now works fine!

Is it possible to set the variable within the main.wxs file so that
candle picks up the value though? Sorry if this is a stupid question!


-----Original Message-----
From: Bob Arnson [mailto:***@joyofsetup.com]
Sent: 23 September 2010 01:32
To: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] Heat.exe
Post by David Amey
Basically I'm using heat to harvest a folder, simples. However I'm
using the "-var" property in the command line (to replace the
"sourceDir" in the output component's source attribute), using a
variable declared in the main.wxs. This replaces the "sourceDir" as
expected, but when it comes to candle to compile , it flags an error as
if the variable isn't populated.

You have to define the values for any preprocessor variables you use in
your source code. How you do that depends on how you run the compiler
(e.g., -d on the command line or DefineConstants in MSBuild) but both
are documented in WiX.chm.

--
sig://boB
http://joyofsetup.com/


------------------------------------------------------------------------
------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
Castro, Edwin G. (Hillsboro)
2010-09-24 15:00:11 UTC
Permalink
No. But you can specify the variable in the *.wixproj file. Set the DefineConstants element (or add to it). You'll need something like the following:

<DefineConstants>VariableName=Path\To\SourceDir</DefineConstants>

Please note that the debug configuration will likely have Debug defined in DefineConstants:

<DefineConstants>Debug;VariableName=Path\To\SourceDir</DefineConstants>

Edwin G. Castro
Software Developer - Staff
Electronic Banking Services
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail
Post by David Amey
-----Original Message-----
Sent: Thursday, September 23, 2010 2:27 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Heat.exe
Thankyou Bob,
This now works fine!
Is it possible to set the variable within the main.wxs file so that candle picks
up the value though? Sorry if this is a stupid question!
-----Original Message-----
Sent: 23 September 2010 01:32
Subject: Re: [WiX-users] Heat.exe
Post by David Amey
Basically I'm using heat to harvest a folder, simples. However I'm
using the "-var" property in the command line (to replace the "sourceDir" in
the output component's source attribute), using a variable declared in the
main.wxs. This replaces the "sourceDir" as expected, but when it comes to
candle to compile , it flags an error as if the variable isn't populated.
You have to define the values for any preprocessor variables you use in your
source code. How you do that depends on how you run the compiler (e.g., -d
on the command line or DefineConstants in MSBuild) but both are
documented in WiX.chm.
--
sig://boB
http://joyofsetup.com/
------------------------------------------------------------------------
------
Start uncovering the many advantages of virtual appliances and start using
them to simplify application deployment and accelerate your shift to cloud
computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances and start using
them to simplify application deployment and accelerate your shift to cloud
computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
WiX-users mailing list
https://
Continue reading on narkive:
Loading...