Archive: extract program version from .h file


extract program version from .h file
I'd like to further automate the release process for my Open Source app. Currently the applications version # is defined in three places:
-a .h file
-the .nsi NSIS script
-a Mac OS X plist file

I can automatically generate a proper Mac OS X Disk image using a bash script which extracts the version from the .h file like so:

VERSION=`cat ../src/${appName}/${appname}.h | awk "/${APPNAME}_VERSION/ {print \\$3}" | sed s/\"//g`

where appName=Reveal and appname and APPNAME are generated like so:

APPNAME=`echo ${appName} | awk '{print toupper($0)}'`
appname=`echo ${appName} | awk '{print tolower($0)}'`

A copy of the .h can be seen here:
http://svn.sourceforge.net/viewcvs.c...markup&rev=824

Currently my NSIS .nsi script defines the version like so:

!define APPNAME "Reveal"
!define APPNAME_LOWER "reveal"
!define APPVERSION "1.0"

Is it possible to automatically determine the application version using the .h file like I do under Bash on OSX using NSIS? It would be really nice to get my installer script working great so I don't have to modify it every time I release a new version!

I looked at the FileOpen and FileRead commands but don't these need to be run within a Function that is inherantly run at installtime? What I'm needing is somethign that is exectued at script compile time so I can appropriately name the generated installer and also properly display the version when running the installer as well. Since the installer is not installing a copy of the source figuring out how to do this at compile time is essential...

-Will


Well unfortunately the Wiki is currently down, but this page will show you (when Wiki is back up) how to use NSIS run time instructions at compile time on the compiling system:

http://nsis.sourceforge.net/Invoking...n_compile-time

-Stu