thoste
6th March 2003 12:27 UTC
How to pass a new variable values to scripts by cmdline ?
Assume I have a succesful working script with a fixed definition like
!define VERSION "V.3.3"
Name "BlaBla ${VERSION}"
Now I want to prepare a new installer exe for version 3.4 by compiling the same old script FROM COMMAND LINE !! but with a new VERSION assignment. The used/included files are all the same. I am thinking about a technique like:
makensis myscript VERSION="V.3.4"
but this doesn't work. How do I assign new values to
script variables without coding them explicitely inside the script?
Thx
Thomas
virtlink
6th March 2003 12:35 UTC
Look here and you will find out that you actually have to use the /D switch:
makensismyscript
/DVERSION="V.3.4"
But then you need to remove the '!define VERSION "V.3.3"' line from the script and compile the V.3.3 script with:
makensismyscript
/DVERSION="V.3.3"
An example is
here, under the header 'How can I make my script depend on some registry value/the version of my product/<something dynamic>?'.
Joost Verburg
6th March 2003 12:36 UTC
Chapter 2 of the docs:
Using the /D switch one or more times will add to symbols to the globally defined list.
Makensis [/Ddefine[=value] ...]
virtlink
6th March 2003 12:40 UTC
Joost, you where just a minute too late: I just told him this. :) ;)
thoste
6th March 2003 14:49 UTC
Hmm, from time to time I want to compile the script by using the GUI.
Ok you said I have to remove the !define VERSION statement in order to be able to compile the nsi script from cmdline.
When I switch later back to the GUI version to compile it from inside the GUI I have to enter the !define statement again.
This is very inconvenient.
It would be better if NSIS would accept command line parameters assginments as assignments with higher priority
Is there maybe another solution ?
Thx
Thomas
Sunjammer
6th March 2003 15:14 UTC
Then instead of removing the define do this:-
!ifndef VERSION
!define VERSION "V.3.3"
!endif