Old 23rd March 2012, 09:31   #1
launchpadtt
Junior Member
 
Join Date: May 2008
Posts: 5
How do I get a single NSIS script with parameters?

Hello,

I have one question. I would like to know how it is possible to have a NSIS script accept command line parameters so that it would do different things depending on whether a command line parameter is supplied or not and based on what the command line parameters are. I've been looking at the wiki and the script reference but I couldn't find that anywhere. I imagine if such a feature exists it would work like
"makensis.exe setup.nsi"
to do one thing and
"makensis.exe setup.nsi standalone"
to do another thing

Any assistance would be appreciated.

thanks
launchpadtt is offline   Reply With Quote
Old 23rd March 2012, 11:32   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You can use the /D switch to supply a define to makensis: http://nsis.sourceforge.net/Docs/Chapter3.html

In your script, then use
!ifdef yourdefine
some code
!else
some other code
!endif

http://nsis.sourceforge.net/Docs/Chapter5.html#5.4.3
MSG is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
command line parameters, parameter

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