Archive: Nsis command line parameters


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!


You should start by reading the help files included with NSIS.

Look at $EXEDIR, $EXEPATH, and $EXEFILE:
http://nsis.sourceforge.net/Docs/Chapter4.html#4.2.3

To get command line options, use the GetParameters and GetOptions macros from the FileFunc.nsh header:
http://nsis.sourceforge.net/Docs/AppendixE.html#E.1


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


It's all in the manual.

http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.11
http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.12

(You'll notice these two are listed directly next to each other.)


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?


parse the parameters manually using WordFind (or WordFind2x) or change your parameters to work with GetOptions