Archive: Function to change the OutFile name


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.


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


The other thing I would suggest, is to just add Version Information to your installer. See Examples\VersionInfo.nsi

-Stu


Thanks for the info.

Might "compile time" functions be added in the future in NSIS ?

Fred


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