Skip to content
⌘ NSIS Forum Archive

Automatic revisoning

17 posts

trankyfunky#

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 😉) )...
Vytautas#
You should check out this archive page and modify the function used there to suit your needs.

Vytautas
trankyfunky#
What do you mean with "latest development version"?
Should I use a CVS snapshot or can I use a simple 2.0b3? 😕

Thanks a lot, Vytautas. I will try it anyway 👍 ....
Joost Verburg#
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.
trankyfunky#
Anyone knows how to compile a CVS snapshot without a C compiler ?😢
Or, maybe, someome knows where could I download a binary CVS build? 🤪

(Maybe a sticky topic on the forum "Latest CVS Binaries" will be useful...)
pengyou#
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.
trankyfunky#
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?
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).
Vytautas#
Sorry for any confusion I caused, it was late and my brain was not functioning very well.

Vytautas
trankyfunky#
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.
trankyfunky#
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)?
kichik#
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.
Afrow UK#
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
Afrow UK#
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
iceman_k#
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.