Old 8th December 2008, 00:18   #1
Shark321
Junior Member
 
Join Date: Nov 2008
Posts: 13
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!
Shark321 is offline   Reply With Quote
Old 8th December 2008, 01:13   #2
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
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
Comperio is offline   Reply With Quote
Old 16th September 2011, 17:23   #3
FrozZerrer
Junior Member
 
Join Date: Sep 2011
Posts: 3
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
FrozZerrer is offline   Reply With Quote
Old 16th September 2011, 17:24   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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.)
MSG is offline   Reply With Quote
Old 16th September 2011, 17:33   #5
FrozZerrer
Junior Member
 
Join Date: Sep 2011
Posts: 3
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?
FrozZerrer is offline   Reply With Quote
Old 16th September 2011, 19:17   #6
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
parse the parameters manually using WordFind (or WordFind2x) or change your parameters to work with GetOptions
Yathosho is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump