12stephan34
17th April 2004 20:50 UTC
Ensuring identical version strings
Dear forum members,
has anyone an idea on how to ensure identical version strings for both the programs?
I have a standard c header file which has a DEFINE for a version string. Is there a way to include this string into the installation script?
Or do other strategies exist for such purposes?
regs,
Stephan
Joost Verburg
17th April 2004 21:09 UTC
You can also use a NSIS header file with a version defined.
If you want to use the same header file for NSIS and your C application you can probably define the NSIS !define to a C define in another C header file.
12stephan34
17th April 2004 21:15 UTC
Did you mean this:
version.h:
#define !define #define
#include "versionfile2"
and
versionfile2
!define "myversionstring"
?
Unfortunately this doesn't work :(
regs,
Stephan
evilO
17th April 2004 21:27 UTC
Hi :)
Err, not sure to have understood exactly what you mean..
Actually it depends whether you want to define it at compile time or runtime.
1) At compile time:
You can give a parameter to the compiler :
/dMYPARAMETER=MYVALUE
2) At runtime :
- You can pass it from the command line to your installer.
- You can read it from the C header file while installing (check http://nsis.sourceforge.net/archive/nsisweb.php for some useful functions...)
evilO/Olive
Joost Verburg
17th April 2004 22:24 UTC
Does you C application compile with version.h included? Any errors?
For NSIS, use versionfile2.
12stephan34
17th April 2004 23:11 UTC
Unfortunately the .h file doesn't work. Apparently, the C compiler has some problems with #define-ing something to #define :)
Joost Verburg
18th April 2004 22:59 UTC
Then add a batch file to your C project that will generate the NSIS header with the version.