Archive: Automatic revisoning


Automatic revisoning
After about one year of developing small and crappy NSIS scripts, I finally started to organize them in a logical structure.
The first thing I suppose to deploy is a "EXE versioning system", that could tell me the build number of my script.
Actually, I use a very simple build number (it's time-related: CrappyScript v.{YYMMDD}) that I set manually thru a !define directive.
It's simple, i know, but for me is enough!

I wonder if there is a simple method to gain the system date to set automatically the !define parameter (or to launch something via !system and get the output, maybe a NSIS script ;)) )...


You should check out this archive page and modify the function used there to suit your needs.

Vytautas


It's already possible :D Grab the latest development version and use ${__DATE__}


What do you mean with "latest development version"?
Should I use a CVS snapshot or can I use a simple 2.0b3? :confused:

Thanks a lot, Vytautas. I will try it anyway :up: ....


Vytautas' solution is for getting the date on run-time.

You need to get the date on compile time, so you should use ${__DATE__}. You have to get the latest CVS version.


Anyone knows how to compile a CVS snapshot without a C compiler ?:cry:
Or, maybe, someome knows where could I download a binary CVS build? :weird:

(Maybe a sticky topic on the forum "Latest CVS Binaries" will be useful...)


The "nightly" CVS snapshot includes the binaries - I am using ${__DATE__} and all the other useful things like it even though I do not have a suitable C compiler. The VersionInformation feature is proving very useful.


Ok... Obtained the "nightly" CVS...
Is the ${__DATE__} function already documented? (I cannot find it on the documentation... maybe I'm blind ;) )
I never heard/seen anything about "VersionInformation". Maybe I've missed something about it?


It has been added a few weeks ago and has not been documented yet.

With the version information commands, you can add a version info resource (File Properties > Version tab).


Sorry for any confusion I caused, it was late and my brain was not functioning very well.

Vytautas


You're welcome, Vytautas.

Seems interesting... The version info commands, I mean.

The only thing I need is some documentation about ${__DATE__}.
I will wait until some documentation will be released.


Just for information, can I format ${__DATE__} contents to fit my needs (YYMMDD or YY.MM.DD) ?
Or maybe there is a method to pass the contents of a $n/$Rn variable to the !define statement (so I will do the dirty job with some crappy script snippet)?


NSIS uses your local date format to set ${__DATE__}. You can't set the format through NSIS. If you want to pass some variables as defines you can create a script that will compile your script calling to makensis with some command line arguments. /Ddefine_name=value will probably be the most useful one for this task.


Originally posted by Joost Verburg
It has been added a few weeks ago and has not been documented yet.

With the version information commands, you can add a version info resource (File Properties > Version tab).
This would be in resource hacker yes?

-Stu

No, that's the whole point, you no longer need Resource Hacker to add it.


Hmm, where is this then?

Edit: ok sorry, I thought that he meant that you need to goto File Properties > Version tab to add one :)

-Stu


Here is some rudimentary documentation on the compile time "standard predefines".
I had a programming itch and I scratched it. :)
I had considered putting in options for formatting the date, but decided to put it off till later. So, for now you will have to live with it grabbing the date format from the user locale settings.