Re: [WiX-users] Types of variables question

2009-10-14 Thread Dave Kolb
Thanks so much Blair. You are absolutely a fountain of knowledge and it is
so wonderful you generously share it. Dave

-Original Message-
From: Blair [mailto:os...@live.com] 
Sent: Wednesday, October 14, 2009 4:59 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Types of variables question

In WiX v3 in candle there are four built-in that start with "$("
(specifically: env, sys, var, & fun). Any preprocessor extension on the
commandline to candle can add others as well.

...


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


Re: [WiX-users] Types of variables question

2009-10-14 Thread Blair
In WiX v3 in candle there are four built-in that start with "$("
(specifically: env, sys, var, & fun). Any preprocessor extension on the
commandline to candle can add others as well.

env, sys, & var are all documented. fun exists for what the preprocessor
calls "functions" but there are no built-in preprocessor functions in WiX
(yet). However, extensions can provide them under their own prefix.

In light (and to a lessor extent in lit) there are three more, both of which
start with "!(" (specifically: wix, bind, & loc). Those are processed later
on when binding either wixlibs or windows installer files (msi, msm, msp,
mst).

!(loc.Name) is used to get strings from .wxl files
!(wix.Name) gets what are called WixVariables (can be defined in source code
with the WixVariable element, or passed on the commandline of light and/or
lit in a manner similar as preprocessor variables are passed to candle).
!(bind.Name) values are assigned values by the binder (the part of light
that takes the linked output and produces the actual windows installer
files). Most of the "bind" values come from data extracted by introspecting
into binary files included by File elements.

By being prefixed with a different character it should be recognized that
they are evaluated at different times (the $ ones by the preprocessor,
meaning they can go almost anywhere, and the ! ones by the binder, meaning
the fields have to allow them to contain these "binder variables") by
different means.

The wix doc does explain these variable types as well in different topics.
Search for the terms "loc bind wix".

Now, regarding the two examples you give:

§  Product/@Version="!(bind.FileVersion.FileId)

The "Product/@Version" part is an XPath fragment. It means "The Version
attribute of the Product element" in your sources.

The "!(bind.FileVersion.FileId)" part is a binder variable. It is the value
of the FileVersion field of either the win32 native VERSION resource OR the
FileVersion .NET file attribute of the binary file who's Id is "FileId".

§  $(fileVersion.ProductName($(var.MyApp.TargetPath)))

The "$(var.MyApp.TargetPath)" part is a preprocessor variable. In this case
it is likely from Votive and is the TargetPath value of the MyApp project in
the same solution as the WiX project being built (and comes from the candle
commandline where Votive put it).

The "$(fileVersion.ProductName([some-binary-file-path])" part likely comes
from a preprocessor extension on codeplex called "fileversion" or some-such.
It is a WiX preprocessor function that takes its argument, cracks open the
file to find the "ProductName" value in the VERSION resource, and returns
that as a string.

Since the preprocessor is somewhat recursive, it understands this is a
preprocessor function call, evaluates the argument "$(var.MyApp.TargetPath)"
passing that result to the "ProductName" function in the extension
implementing the "fileversion" prefix, and using the result of the function
call as the result of the entire expression.

-Original Message-
From: Dave Kolb [mailto:d...@dotnetcodeslingers.com] 
Sent: Wednesday, October 14, 2009 12:13 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: [WiX-users] Types of variables question

I understand these variable types from the wix doc:

 

$(env._NtPostBld) 

Gets the environment variable %_NtPostBld% 

$(sys.CURRENTDIR) 

Gets the system variable for the current directory 

$(var.A) 

Gets the variable A that was defined in this xml 

 

 

But what are these that I have seen in an example??? Is there doc on ALL the
types of variables that can be used in a .wxs file?

 

§  Product/@Version="!(bind.FileVersion.FileId) ---à two unknown
types - the @ syntax and the ! syntax with 2 levels

§  $(fileVersion.ProductName($(var.MyApp.TargetPath))) ---à what is
fileVersion and what's the deal with the 2 levels of var. syntax

 

- Dave


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.s