Archive: nsis script using dos command line parameters


nsis script using dos command line parameters
Hi,

I've created a script that does what I want for 1 particular project, I now want to reuse the script for another 2 similar packages, rather than having several scripts in my file system I want to use a batch script for each package that calls the nsis script, BUT, allows me to pick up a project specifier from the command line and use it as a variable in the nsis script

e.g. makensis script.nsi project1, or makensis script.nsi project2

so that the nsis script will use the project1 or project2 internally for changing text/installer bitmaps etc.

Can anyone give me any pointers on a way to do this.

Regards

J


if you use conditional compilation (using !if, by example), you can set variables in the command line using:

makensis script.nsi /DProject=Project1

then inside the script you can test like this


!if ${Project} == "Project1"
... code for Project1
!endif

Parameters should be other way around. The /D should come first or else it won't be defined in the script.