Archive: One more Version Info question


One more Version Info question
Is there any way to add a build date to the Version tab?
More generally, is there any way to obtain system values such as date during compile time?


You can add any key=values to version tab, just use VIAddVersionKey [key_name] [value_text], it can have the names and text you want, basically the examples just add standard key, like CompanyName, ProductVersion, etc

But you need to wait by the implementation of the defines
DATE, FILE, TIME, etc. :)

Then you can do something like:
VIAddVersionKey "CompileTime" "$DATE - $TIME"

cyas,
Ramon


That's what I had suspected. :)
Thanks.


If these get implemented can we at least keep to some sort of standard, e.g. in C you have __DATE__, __TIME__,__TIMESTAMP__ and __FILE__ (taken from here. There's no reason for these to be variables, you shouldn't be able to assign to them.


Imo it should be like NSISDIR etc.: ${DATE}, ${TIME}


I vote for ${__DATE__} :)
The only problem I have with this is that ${__TIME__}, if following the standard, will not be usable in file names because of the colons.


Honestly I've never liked ${NSISDIR} because it looks like a variable yet it shouldn't do. So when arguing for NSIS consistency I'd go for ${DATE},${TIME},${NSISDIR} or __DATE__,__TIME__,__NSISDIR__ :D


Maybe, we need an additional command for formatting Time in that case.

Originally posted by kichik
I vote for ${__DATE__} :)
The only problem I have with this is that ${__TIME__}, if following the standard, will not be usable in file names because of the colons.

Why not
$NSISDIR, $DATE, $TIME, etc.
I agree, the opening and closing braces are confusing in ${NSISDIR}.
It is the only predefined variable with braces.

Originally posted by Sunjammer
Honestly I've never liked ${NSISDIR} because it looks like a variable yet it shouldn't do. So when arguing for NSIS consistency I'd go for ${DATE},${TIME},${NSISDIR} or __DATE__,__TIME__,__NSISDIR__ :D

No they are not. There are plenty more such as NSIS_MAX_INST_TYPES, NSIS_MAX_STRLEN, NSIS_SUPPORT_* and more. Changing ${NSISDIR} to $NSISDIR will cause confusion and people might think it's a variable and not a constant.


There is a big difference between normal run-time variables (like $INSTDIR) and compile-time constants.

${define} is a compile-time define that will be replaced on compile time by the value of the define. ${NSISDIR} is also a define.

Imo all defines should look the same. Other script languages use {$define}, maybe that's a bit better.


I was driving back to the office from lunch, when I figured this out. :D
Braces means compile-time resolution and no brace means run-time resolution.
Anyhow, if you need an volunteer to implement this, I am available.
:)


Go for it, you still have CVS access ;)


I agree Joost Verburg :)


OK, the latest CVS version supports the following "standard" predefines:
${__DATE__} The compilation date. The date is formatted using the current user locale setting for short date.
${__TIME__} The compilation time. The time is formatted using the current user locale.
${__FILE__} The name of the current source file. Does not contain full path info- only the file name.
${__LINE__} The line number in the current source file.
${__TIMESTAMP__} The date and time of the last modification of the current source file. The timestamp is formatted using the current user locale setting for long date.

makensis should be compiled with NSIS_SUPPORT_STANDARD_PREDEFINES defined (in exehead\config.h).


${__TIMESTAMP__} produces a single space when used on my Win98SE system. My system uses "dd MMMM yyyy" for the long date format.

${__DATE__} and ${__TIME__} work OK as does ${__FILE__}.


The CVS version should fix this bug.


After updating to current CVS snapshot, I found that ${__TIMESTAMP__} now works properly on my WIn98SE system.

Thanks for fixing this so quickly.

Brian


You're welcome.