Skip to content
⌘ NSIS Forum Archive

Nsis command line parameters

6 posts

Shark321#

Nsis command line parameters

Hi!

is there a way to find out these 2 things in a nsis script:

1. name of the installer (e.g. myapp210.exe).

2. the command line parameters passed to the installer.

thanks in advance!
Comperio#
You should start by reading the help files included with NSIS.

Look at $EXEDIR, $EXEPATH, and $EXEFILE:


To get command line options, use the GetParameters and GetOptions macros from the FileFunc.nsh header:
FrozZerrer#
Parameters parsing

Hi, sorry to bump up this old thread. I just want to know how can I parse the parameters once I got them with GetParameters(). How can I have each one individually?

For exemple :
I want to pass in parameter a list of files. After I want to execute them in the installer. HOw can I put all the files names in a list to execute them when needed?

Thanks
MSG#
It's all in the manual.




(You'll notice these two are listed directly next to each other.)
FrozZerrer#
Thanks for your response, it's appreciated. I already read this, but I can't manage to find how to get a list of file. My list doesn't have a fixed length. So, sometimes I have 5 subinstallers to execute and in another situation I can have only 3.

Command exemple :

Ex1 => C:\myInstaller.exe subInst1.exe subInst2.exe subInst3.exe
I want to get subInst1.exe subInst2.exe subInst3.exe and execute them.

Ex2 => C:\myInstaller.exe subInst1.exe subInst2.exe subInst3.exe subInst4.exe subInst5.exe
I want to get subInst1.exe subInst2.exe subInst3.exe subInst4.exe subInst5.exe and execute them.

Etc.

Any idea?
Yathosho#
parse the parameters manually using WordFind (or WordFind2x) or change your parameters to work with GetOptions