|
|
#1 |
|
Junior Member
Join Date: Jul 2002
Posts: 2
|
Variable output file
I am working on a cross platform project and would like NSIS to generate an output file like d-builder-0.0.4.exe where the 0.0.4 is the current version number. This version number is in a file all by itself for me to compile into my code
I have tried to come up with a script to make NSIS read this file to get the version number and create an output file with that version number in it like: FileOpen $8 ../version r FileRead $8 $9 FileClose $8 OutFile "d-builder-$8.exe" but File* commands have to be in a section and the OutFile is not valid in a section... Any suggestions? |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Mar 2002
Location: France / Paris
Posts: 138
|
NSIS installation script uses defines !
!define VER_MAJOR 1 !define VER_MINOR 98 nsis${VER_MAJOR}${VER_MINOR}_fr.exe
|
|
|
|
|
|
#3 | |
|
Senior Member
|
Re: Variable output file
Quote:
|
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jul 2002
Posts: 2
|
part deaux
ok, i can live with that, but when i run the comand line version with the define in the command line... it still does not use the define (it will use the define if i explicitly put the define in the script, but that is not what i want)
command line: "C:\Program Files\NSIS\makensis.exe" /V4 /CD d-builder.nsi /DDBUILDERVERSION=0.0.4 script: Name "Distributed Builder" OutFile "d-builder-${DBUILDERVERSION}.exe" it notices my command line define, but does not substitute the variable for the value I tried just putting a !define DBUILDERVERSION "0.0.4" above the OutFile and it works fine, so the problem it just the command line define |
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
Uservariables and defines only get their value at runtime. When you compile, the variables will not have a value yet and that's why you can't use them in compiling commands like OutFile and File.
-Hendri. |
|
|
|
#6 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Your command line define doesn't work because you specify it after the name of the script to compile. Don't ask me why, but this is how it is...
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|