10

I am trying to make my setups scripts modular. I am calling setup exe's from within main setup script based to the requirements. I want to pass command line arguments to the exe being called. Can someone please tell me how to access the command line arguments in the script being called.

Thanks in advance.

user774294
  • 121
  • 1
  • 1
  • 6

2 Answers2

22

you can use GetOptions function (FileFunc.nsh must be included above). Following example shows p parameter reading; its value is saved into the variable. $CMDLINE is your command line (absolute or relative, as you called) containing also your parameters.

!include FileFunc.nsh

Var variable    
${GetOptions} $CMDLINE "/p" $variable
C4d
  • 3,183
  • 4
  • 29
  • 50
zbynour
  • 19,747
  • 3
  • 30
  • 44
1

Try to get options from Command line by their name: http://nsis.sourceforge.net/Get_command_line_parameter_by_name

Slappy
  • 5,250
  • 1
  • 23
  • 29