Archive: Getting Outfile as a variable in compile time


Getting Outfile as a variable in compile time
Hello,

I would like to write the name of the created installer into a file on compiling. I just found ${__FILE__} but that return the name of the script.

I guess I could use !define and use that variable with Outfile and for writing into a file.

Is there any other way I missed?


!define OutFile "setup.exe"
OutFile "${OutFile}"

!system "echo ${OutFile} >OutFile.txt"


If you need to do more operations then look at this:
http://nsis.sourceforge.net/Invoking...n_compile-time

-Stu

Ok, that´s the way I already implemented it.


!ifdef FULLSETUP
!ifdef NORMAL
!define OUTFILE "u:\larsen\${version}\EasyBuyer_Setup_${VERSION}.exe"
!else
!define OUTFILE "u:\larsen\${version}\EasyBuyer_Setup_Light_${VERSION}.exe"
!endif
!else
!ifdef NORMAL
!define OUTFILE "u:\larsen\${version}\EasyBuyer_SP_${VERSION}.exe"
!else
!define OUTFILE "u:\larsen\${version}\EasyBuyer_SP_Light_${VERSION}.exe"
!endif
!endif

OutFile ${OUTFILE}


Next problem I have is that I just want to use the file part of OutFile. So my code should look like this (unfortunately doesn´t work):


!define OUTDIR "u:\larsen\${version}\"

# <code to set OUTFILE according to defines>
!define OUTFILE "EasyBuyer_SP_Light_${VERSION}.exe"

#concatenate string outside section
# would be very useful
OutFile ${OUTDIR}.${OUTFILE}

# code to insert ${OUTFILE} in php script to be included
# ...


Of course, I could write text into a temporay file somehow, but that would not be very elegant, I guess. Therefore, I will use two defines - and so being redundant =(

OutFile "${OUTDIR}${OUTFILE}"

-Stu


Oh, that simple.
Again, thank you very much!