Fred Delhoume
16th August 2004 11:02 UTC
Function to change the OutFile name
Hi,
I would like to add the current date in the outfile name (because of nightly builds).
However, the date items are separated by slahes that are not allowed in file names.
I have found a function named ConvertBStoDBS that I have changed to
ConvertBStoDash.
I have some difficulties using it to get the correct output name.
I have tried addind in my .onInit the following code :
Push ${__DATE__}
Call ConvertBStoDash
Pop $DASHDATE
and in my normal code :
Var DASHDATE
OutFile "programname${DASHDATE}.exe"
It seems that either my code is not called or something else is wrong because I get errors or my output file is programname${DASHDATE}.exe.
Thanks for your help.
Regards,
Frederic.
Afrow UK
16th August 2004 11:30 UTC
OutFile is a compile time command. Therefore, it is set on compile time only, and cannot be changed on run time.
The only thing that I suggest, is that you write a seperate program that writes the current date into your script.
-Stu
Afrow UK
16th August 2004 11:40 UTC
The other thing I would suggest, is to just add Version Information to your installer. See Examples\VersionInfo.nsi
-Stu
Fred Delhoume
16th August 2004 12:27 UTC
Thanks for the info.
Might "compile time" functions be added in the future in NSIS ?
Fred
Afrow UK
16th August 2004 12:30 UTC
Perhaps.
What the NSIS dev team should add is ${__DASHDATE__} with dashes rather than strokes/back strokes.
You could then just use OutFile "file_${__DASHDATE__}.exe"
-Stu