I think there are a number of alternatives, but the one I use personally is to 
include a dependent project in the VS2010 solution that generates a version.wxi 
file that I then include in the installer's wxs file using the WiX preprocessor 
e.g. <?include "version.wxi"?>. The generated version.wxi looks something like:

<?xml version="1.0" encoding="utf-8"?>
<Include>
    <?define ProductVersion = "1.0.0" ?>
</Include>

so it is very easy to generate and could even be done with a Makefile project 
and a batch script, or even in a pre-build step. I use a separate project 
because I also generate version information for resources, splash screens, etc.

Once you have included version.wxi in your wxs you can refer to the product 
version as $(var.ProductVersion).

Daniel Madill
www.quanser.com

-----Original Message-----
From: Don Reba [mailto:don_r...@inbox.ru] 
Sent: February-10-13 2:05 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] VS - version number from file

If I run Candle from the command line, I can set an environmental variable 
to the contents of the file containing my project version number:

set/p ProjectVersion=<version.txt

I can then use refer to it as $(env.ProjectVersion) in the Candle source 
file. However, I have not found a way to do the same in Visual Studio 2010. 
Environmental variables set in a pre-build event do not seem to show up. Is 
there an alternative? 



------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to