Archive: ${__TIMESTAMP__} is not always predefined


${__TIMESTAMP__} is not always predefined
Some of my scripts use the ${__TIMESTAMP__} predefine to record the date and time of the last modification to the script. I have found that in some cases the compiler gives an "unknown variable/constant" warning for this predefine.

This warning seems to be generated if the script file is not in the current directory. Here is my test script:

Name "Test"

OutFile test.exe

ShowInstDetails show

RequestExecutionLevel "user"

Page instfiles

Section default
DetailPrint "Filename : ${__FILE__}"
DetailPrint "Timestamp: ${__TIMESTAMP__}"
SectionEnd
The command-line "makensis.exe test.nsi" works properly but if I put the script in a subdirectory and use the command-line

makensis.exe subdir\test.nsi

then the compiler issues this warning:

unknown variable/constant "{__TIMESTAMP__}" detected, ignoring (subdir\test.nsi:13)

and, of course, the test program displays:

Filename : test.nsi
Timestamp: ${__TIMESTAMP__}
Completed

I wonder if the precompiler even keeps that define per-file...

Anyway, please file a bug report about this in the bug tracker, if it doesn't already exist at least.


If I use the command-line

makensis.exe /NOCD subdir\test.nsi

then test.exe gets generated in the current directory without any warnings and it produces the correct output:

Filename : test.nsi
Timestamp: 19 November 2009 17:18:42
Completed

I'll have a look at the bug tracker now.