Archive: Ensuring identical version strings


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


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.


Did you mean this:

version.h:

#define !define #define

#include "versionfile2"

and

versionfile2

!define "myversionstring"

?

Unfortunately this doesn't work :(

regs,

Stephan


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


Does you C application compile with version.h included? Any errors?

For NSIS, use versionfile2.


Unfortunately the .h file doesn't work. Apparently, the C compiler has some problems with #define-ing something to #define :)


Then add a batch file to your C project that will generate the NSIS header with the version.