Discussion:
[WiX-users] preprocessor variable $(var.Build)
Friedrich, Oliver
2006-10-30 20:27:01 UTC
Permalink
Again its me,



currently I`m trying to convert our V2 setup to V3 using a
votive-project in our solution.



One of my problems now is, that we used the pre-processor variable
"var.Build" in our setup for finding the final sourcepath of our apps.
But votive won`t compile with it used like that:



<?define
SourcePath_MMC="$(var.CommonBasePath)\MMC\Mmc\bin\$(var.Build)\"?>



Already tried "env.Build" but this did not work either.



Any hints welcome...



Oliver Friedrich
Consultant - Software Solutions

prodot GmbH
Carl-Peschken-Strasse 5d
47441 Moers
Germany

Phone +49 (2841) 173 91 - 0
Fax +49 (2841) 173 91 - 20

http://www.prodot.de <http://www.prodot.de>
Bob Arnson
2006-10-31 00:51:37 UTC
Permalink
Post by Friedrich, Oliver
One of my problems now is, that we used the pre-processor variable
"var.Build" in our setup for finding the final sourcepath of our apps.
We need more detail to help. What happens? Do you get an error message?
Where did you specify the value for Build?
--
sig://boB
http://bobs.org
Friedrich, Oliver
2006-10-31 07:49:28 UTC
Permalink
That`s the point, this variable is defined nowhere in the source.

We used WiXV2 manually written files added to a blank solution in
vs2005, compiled via batch on post-build-action.

The error that raises at compile-time is that the preprocessor variable
"$(var.Build)" is not defined. It should contain the information what
build type the solution actually uses (Debug||Release) and it is used by
our WiX-script to complete the path to install the files from.

Hope those Information is usefull anyway...

Oliver Friedrich

PS: Sorry for the malformed mails, I will talk to my *shiver* Outlook as
soon as I get some spare time...


________________________________

From: Bob Arnson [mailto:***@bobs.org]
Sent: Tuesday, October 31, 2006 1:52 AM
To: Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] preprocessor variable $(var.Build)


Friedrich, Oliver wrote:

One of my problems now is, that we used the
pre-processor variable "var.Build" in our setup for finding the final
sourcepath of our apps. But votive won`t compile with it used like that:


We need more detail to help. What happens? Do you get an error
message? Where did you specify the value for Build?


--
sig://boB
http://bobs.org
Bob Arnson
2006-10-31 15:43:19 UTC
Permalink
Post by Friedrich, Oliver
That`s the point, this variable is defined nowhere in the source.
We used WiXV2 manually written files added to a blank solution
in vs2005, compiled via batch on post-build-action.
The error that raises at compile-time is that the preprocessor
variable "$(var.Build)" is not defined. It should contain the
information what build type the solution actually uses
(Debug||Release) and it is used by our WiX-script to complete the path
to install the files from.
So are you saying that Votive v2 defines var.Build but Votive v3 doesn't?
--
sig://boB
http://bobs.org
Friedrich, Oliver
2006-10-31 16:04:51 UTC
Permalink
No, we did not use Votive V2, just plain wxs-files that we added to a
simple solution, we did not use Votive V2.





________________________________

From: Bob Arnson [mailto:***@bobs.org]
Sent: Tuesday, October 31, 2006 4:43 PM
To: Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] preprocessor variable $(var.Build)


Friedrich, Oliver wrote:

That`s the point, this variable is defined nowhere in
the source.

We used WiXV2 manually written files added to a blank
solution in vs2005, compiled via batch on post-build-action.

The error that raises at compile-time is that the
preprocessor variable "$(var.Build)" is not defined. It should contain
the information what build type the solution actually uses
(Debug||Release) and it is used by our WiX-script to complete the path
to install the files from.



So are you saying that Votive v2 defines var.Build but Votive v3
doesn't?


--
sig://boB
http://bobs.org
Bob Arnson
2006-11-03 17:04:02 UTC
Permalink
Post by Friedrich, Oliver
No, we did not use Votive V2, just plain wxs-files that we added to a
simple solution, we did not use Votive V2.
Sorry, I'm not understanding. Are you asking how to set the Build
variable using Votive?
--
sig://boB
http://bobs.org
Friedrich, Oliver
2006-11-06 13:20:58 UTC
Permalink
Alright, just found out, where this variable was set. It is set on the
commandline while calling the batch-file to start the compilation of the
setup.

The batch-file is called as "Pre-build event command line" in VS2005.
The variable "var.Build" is set to the value of "$(ConfigurationName)".
The last is homemade of VisualStudio. How can I access this
"ConfigurationName" under WiX-V3?

Sorry for the trouble...

Oliver


________________________________

From: Bob Arnson [mailto:***@bobs.org]
Sent: Friday, November 03, 2006 6:04 PM
To: Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] preprocessor variable $(var.Build)


Friedrich, Oliver wrote:

No, we did not use Votive V2, just plain wxs-files that
we added to a simple solution, we did not use Votive V2.


Sorry, I'm not understanding. Are you asking how to set the
Build variable using Votive?


--
sig://boB
http://bobs.org
Bob Arnson
2006-11-07 03:28:08 UTC
Permalink
Alright, just found out, where this variable was set. It is set on the commandline while calling the batch-file to start the compilation of the setup.
The batch-file is called as "Pre-build event command line" in VS2005.
The variable "var.Build" is set to the value of
"$(ConfigurationName)". The last is homemade of VisualStudio. How can
I access this "ConfigurationName" under WiX-V3?
WiX doesn't support that as it's a Visual Studio-specific concept.
Votive might, though. JRock?
--
sig://boB
http://bobs.org
Justin Rockwood
2006-11-07 05:57:30 UTC
Permalink
The variable $(Configuration) is set by most MSBuild scripts automatically
(C#, VB, VJ#, WiX, etc.). Also, $(ConfigurationName) is usually set as well,
but I'd probably go with $(Configuration). You won't be able to know what
the configuration is outside of MSBuild, but assuming that you're using C#
or VB.NET, then you should already have this defined for you by the time you
call your Pre-build event.



If you're using Votive (and therefore wix.targets), then you also get
$(Configuration) defined for you. I'm not sure if $(ConfigurationName) is
defined. If not, it's a bug.



Justin



From: Bob Arnson [mailto:***@bobs.org]
Sent: Monday, November 06, 2006 7:28 PM
To: Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net; ***@cs.stanford.edu
Subject: Re: [WiX-users] preprocessor variable $(var.Build)



Friedrich, Oliver wrote:

Alright, just found out, where this variable was set. It is set on the
commandline while calling the batch-file to start the compilation of the
setup.



The batch-file is called as "Pre-build event command line" in VS2005. The
variable "var.Build" is set to the value of "$(ConfigurationName)". The last
is homemade of VisualStudio. How can I access this "ConfigurationName" under
WiX-V3?


WiX doesn't support that as it's a Visual Studio-specific concept. Votive
might, though. JRock?
--
sig://boB

http://bobs.org
Lerudjordet, Morten Minge
2006-11-06 14:26:27 UTC
Permalink
To get wix to use the var it has to run in the context where the
$(ConfigurationName) is set (candle compile).

You then compile wixobj with: candle.exe -dMyVar =
$(ConfigurationName)...
Then you should be able to access the $(var.MyVar) in the wix code.

Usually this is set up in a msbuld script and passed when compiling the
wxs files to wixobj.

morten

Message: 6
Date: Mon, 6 Nov 2006 14:20:58 +0100
From: "Friedrich, Oliver" <***@prodot.de>
Subject: Re: [WiX-users] preprocessor variable $(var.Build)
To: <wix-***@lists.sourceforge.net>
Message-ID: <***@mail.prodot.local>
Content-Type: text/plain; charset="us-ascii"


Alright, just found out, where this variable was set. It is set on the
commandline while calling the batch-file to start the compilation of the
setup.

The batch-file is called as "Pre-build event command line" in VS2005.
The variable "var.Build" is set to the value of "$(ConfigurationName)".
The last is homemade of VisualStudio. How can I access this
"ConfigurationName" under WiX-V3?

Sorry for the trouble...

Oliver


________________________________

From: Bob Arnson [mailto:***@bobs.org]
Sent: Friday, November 03, 2006 6:04 PM
To: Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] preprocessor variable $(var.Build)


Friedrich, Oliver wrote:

No, we did not use Votive V2, just plain wxs-files that
we added to a simple solution, we did not use Votive V2.


Sorry, I'm not understanding. Are you asking how to set the
Build variable using Votive?


--
sig://boB
http://bobs.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://sourceforge.net/mailarchive/forum.php?forum=wix-users/attachments
/20061106/70c1b015/attachment.html

------------------------------

------------------------------------------------------------------------
-
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

------------------------------

_______________________________________________
WiX-users mailing list
WiX-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


End of WiX-users Digest, Vol 6, Issue 21
****************************************
Friedrich, Oliver
2006-11-07 08:37:07 UTC
Permalink
Well, seems like $(Configuration) is set by Votive, but inside the
WiX-code I can not access it?

With : <Property Id='MyProp' Value=$(Configuration)/>
I get the Errormessage:

Error 1 Ill-formed preprocessor variable 'Configuration'. Variables
must have a prefix (like 'var.', 'env.', or 'sys.') and a name at least
1 character long. Z:\Projects\Aldi -
Intranet\EwsSetup\Features\Ews_Mmc.wxs 5 1 EwsSetup

Those three throw "Undefined preprocessor variable":
<Property Id='MyProp' Value=$(var.Configuration)/>
<Property Id='MyProp' Value=$(sys.Configuration)/>
<Property Id='MyProp' Value=$(env.Configuration)/>

On the properties of the .wixproj in the linker tab, there I can set
userdefined variables, there I added "Configuration=$Configuration" but
even then, I can not access this variable like above inside my WiX-code.

Oliver



________________________________

From: Justin Rockwood [mailto:***@cs.stanford.edu]
Sent: Tuesday, November 07, 2006 6:58 AM
To: 'Bob Arnson'; Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net; ***@cs.stanford.edu
Subject: RE: [WiX-users] preprocessor variable $(var.Build)



The variable $(Configuration) is set by most MSBuild scripts
automatically (C#, VB, VJ#, WiX, etc.). Also, $(ConfigurationName) is
usually set as well, but I'd probably go with $(Configuration). You
won't be able to know what the configuration is outside of MSBuild, but
assuming that you're using C# or VB.NET, then you should already have
this defined for you by the time you call your Pre-build event.



If you're using Votive (and therefore wix.targets), then you
also get $(Configuration) defined for you. I'm not sure if
$(ConfigurationName) is defined. If not, it's a bug.



Justin



From: Bob Arnson [mailto:***@bobs.org]
Sent: Monday, November 06, 2006 7:28 PM
To: Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net; ***@cs.stanford.edu
Subject: Re: [WiX-users] preprocessor variable $(var.Build)



Friedrich, Oliver wrote:

Alright, just found out, where this variable was set. It is set
on the commandline while calling the batch-file to start the compilation
of the setup.



The batch-file is called as "Pre-build event command line" in
VS2005. The variable "var.Build" is set to the value of
"$(ConfigurationName)". The last is homemade of VisualStudio. How can I
access this "ConfigurationName" under WiX-V3?


WiX doesn't support that as it's a Visual Studio-specific
concept. Votive might, though. JRock?




--

sig://boB

http://bobs.org
Foster, Richard - PAL
2006-11-07 15:33:58 UTC
Permalink
Oliver,

I'm still a bit unsure about where you are getting the error (I.e. are
you building the installation from the command line? Within Visual
Studio 2005? Somewhere else?). Unfortunately, I also don't use Votive so
the vast majority of this reply is guesswork!

I suspect that the MSBuild variable "Configuration" is being set, but
that when you are seeing the error it is because this variable is never
being passed to WiX.

Depending on your build process, to get the information to WiX you may
need to pass it via the command line (e.g.
-dWixVariableName=$(MSBuildVariableName) ), in which case you would
access it using $(var.WixVariableName), or set an environment variable
(e.g. set SomeEnvironmentVariable=$(MSBuildVariableName) ) and access it
in WiX using $(env.SomeEnvironmentVariable).

It is likely that Votive is intended to do this for you (like I said, I
don't use Votive, so I don't know for certain), in which case you may
have uncovered a bug.

I also notice that you mention that you found a batch file setting
"var.Build" to "$(ConfigurationName)". If true, this may not be
desirable, since within WiX you may then need to reference that variable
as $(var.var.Build). Within it's scripts, WiX requires the addition of
the var prefix to indicate that you want to use a WiX variable (not an
environment variable or system setting), but you do not specify that
prefix when defining the variable.

Hopefully this offers at least some additional information which may
help you determine where you need to look.

Regards,
Richard
________________________________

From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Friedrich,
Oliver
Sent: Tuesday, November 07, 2006 03:37
To: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] preprocessor variable $(var.Build)


Well, seems like $(Configuration) is set by Votive, but inside the
WiX-code I can not access it?

With : <Property Id='MyProp' Value=$(Configuration)/>
I get the Errormessage:

Error 1 Ill-formed preprocessor variable 'Configuration'. Variables
must have a prefix (like 'var.', 'env.', or 'sys.') and a name at least
1 character long. Z:\Projects\Aldi -
Intranet\EwsSetup\Features\Ews_Mmc.wxs 5 1 EwsSetup

Those three throw "Undefined preprocessor variable":
<Property Id='MyProp' Value=$(var.Configuration)/>
<Property Id='MyProp' Value=$(sys.Configuration)/>
<Property Id='MyProp' Value=$(env.Configuration)/>

On the properties of the .wixproj in the linker tab, there I can set
userdefined variables, there I added "Configuration=$Configuration" but
even then, I can not access this variable like above inside my WiX-code.

Oliver



________________________________

From: Justin Rockwood [mailto:***@cs.stanford.edu]
Sent: Tuesday, November 07, 2006 6:58 AM
To: 'Bob Arnson'; Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net; ***@cs.stanford.edu
Subject: RE: [WiX-users] preprocessor variable $(var.Build)



The variable $(Configuration) is set by most MSBuild scripts
automatically (C#, VB, VJ#, WiX, etc.). Also, $(ConfigurationName) is
usually set as well, but I'd probably go with $(Configuration). You
won't be able to know what the configuration is outside of MSBuild, but
assuming that you're using C# or VB.NET, then you should already have
this defined for you by the time you call your Pre-build event.



If you're using Votive (and therefore wix.targets), then you
also get $(Configuration) defined for you. I'm not sure if
$(ConfigurationName) is defined. If not, it's a bug.



Justin



From: Bob Arnson [mailto:***@bobs.org]
Sent: Monday, November 06, 2006 7:28 PM
To: Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net; ***@cs.stanford.edu
Subject: Re: [WiX-users] preprocessor variable $(var.Build)



Friedrich, Oliver wrote:

Alright, just found out, where this variable was set. It is set
on the commandline while calling the batch-file to start the compilation
of the setup.



The batch-file is called as "Pre-build event command line" in
VS2005. The variable "var.Build" is set to the value of
"$(ConfigurationName)". The last is homemade of VisualStudio. How can I
access this "ConfigurationName" under WiX-V3?


WiX doesn't support that as it's a Visual Studio-specific
concept. Votive might, though. JRock?




--

sig://boB

http://bobs.org




* C O N F I D E N T I A L I T Y N O T I C E *
-----------------------------------------------------------
The content of this e-mail is intended solely for the use of the individual or entity to whom it is addressed. If you have received this communication in error, be aware that forwarding it, copying it, or in any way disclosing its content to any other person, is strictly prohibited. Peek Traffic Corporation is neither liable for the contents, nor for the proper, complete and timely transmission of (the information contained in) this communication. If you have received this communication in error, please notify the author by replying to this e-mail immediately and delete the material from any computer.
Justin Rockwood
2006-11-07 18:06:22 UTC
Permalink
Yep, Oliver summed it up pretty well. As far as Votive is concerned, you can
define the preprocessor variable by entering
"Configuration=$(Configuration)" on the compiler property page (not linker
property page). Also, make sure to put the parenthesis (which you missed in
your example below). I think this is just a case of incorrect syntax for
you.



Justin





From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Foster,
Richard - PAL
Sent: Tuesday, November 07, 2006 7:34 AM
To: Friedrich, Oliver; wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] preprocessor variable $(var.Build)



Oliver,



I'm still a bit unsure about where you are getting the error (I.e. are you
building the installation from the command line? Within Visual Studio 2005?
Somewhere else?). Unfortunately, I also don't use Votive so the vast
majority of this reply is guesswork!



I suspect that the MSBuild variable "Configuration" is being set, but that
when you are seeing the error it is because this variable is never being
passed to WiX.



Depending on your build process, to get the information to WiX you may need
to pass it via the command line (e.g.
-dWixVariableName=$(MSBuildVariableName) ), in which case you would access
it using $(var.WixVariableName), or set an environment variable (e.g. set
SomeEnvironmentVariable=$(MSBuildVariableName) ) and access it in WiX using
$(env.SomeEnvironmentVariable).



It is likely that Votive is intended to do this for you (like I said, I
don't use Votive, so I don't know for certain), in which case you may have
uncovered a bug.



I also notice that you mention that you found a batch file setting
"var.Build" to "$(ConfigurationName)". If true, this may not be desirable,
since within WiX you may then need to reference that variable as
$(var.var.Build). Within it's scripts, WiX requires the addition of the var
prefix to indicate that you want to use a WiX variable (not an environment
variable or system setting), but you do not specify that prefix when
defining the variable.



Hopefully this offers at least some additional information which may help
you determine where you need to look.



Regards,

Richard

_____

From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Friedrich,
Oliver
Sent: Tuesday, November 07, 2006 03:37
To: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] preprocessor variable $(var.Build)

Well, seems like $(Configuration) is set by Votive, but inside the WiX-code
I can not access it?



With : <Property Id='MyProp' Value=$(Configuration)/>

I get the Errormessage:



Error 1 Ill-formed preprocessor variable 'Configuration'. Variables must
have a prefix (like 'var.', 'env.', or 'sys.') and a name at least 1
character long. Z:\Projects\Aldi - Intranet\EwsSetup\Features\Ews_Mmc.wxs 5
1 EwsSetup



Those three throw "Undefined preprocessor variable":

<Property Id='MyProp' Value=$(var.Configuration)/>

<Property Id='MyProp' Value=$(sys.Configuration)/>

<Property Id='MyProp' Value=$(env.Configuration)/>



On the properties of the .wixproj in the linker tab, there I can set
userdefined variables, there I added "Configuration=$Configuration" but even
then, I can not access this variable like above inside my WiX-code.



Oliver






_____


From: Justin Rockwood [mailto:***@cs.stanford.edu]
Sent: Tuesday, November 07, 2006 6:58 AM
To: 'Bob Arnson'; Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net; ***@cs.stanford.edu
Subject: RE: [WiX-users] preprocessor variable $(var.Build)

The variable $(Configuration) is set by most MSBuild scripts automatically
(C#, VB, VJ#, WiX, etc.). Also, $(ConfigurationName) is usually set as well,
but I'd probably go with $(Configuration). You won't be able to know what
the configuration is outside of MSBuild, but assuming that you're using C#
or VB.NET, then you should already have this defined for you by the time you
call your Pre-build event.



If you're using Votive (and therefore wix.targets), then you also get
$(Configuration) defined for you. I'm not sure if $(ConfigurationName) is
defined. If not, it's a bug.



Justin



From: Bob Arnson [mailto:***@bobs.org]
Sent: Monday, November 06, 2006 7:28 PM
To: Friedrich, Oliver
Cc: wix-***@lists.sourceforge.net; ***@cs.stanford.edu
Subject: Re: [WiX-users] preprocessor variable $(var.Build)



Friedrich, Oliver wrote:

Alright, just found out, where this variable was set. It is set on the
commandline while calling the batch-file to start the compilation of the
setup.



The batch-file is called as "Pre-build event command line" in VS2005. The
variable "var.Build" is set to the value of "$(ConfigurationName)". The last
is homemade of VisualStudio. How can I access this "ConfigurationName" under
WiX-V3?


WiX doesn't support that as it's a Visual Studio-specific concept. Votive
might, though. JRock?
--
sig://boB

http://bobs.org

_____


* C O N F I D E N T I A L I T Y N O T I C E *
-----------------------------------------------------------
The content of this e-mail is intended solely for the use of the individual
or entity to whom it is addressed. If you have received this communication
in error, be aware that forwarding it, copying it, or in any way disclosing
its content to any other person, is strictly prohibited. Peek Traffic
Corporation is neither liable for the contents, nor for the proper, complete
and timely transmission of (the information contained in) this
communication. If you have received this communication in error, please
notify the author by replying to this e-mail immediately and delete the
material from any computer.
Continue reading on narkive:
Loading...