Accessing command line arguments in NSIS

谁说我不能喝 提交于 2019-11-29 10:48:21

问题


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.


回答1:


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

${GetOptions} $CMDLINE "/p" $variable



回答2:


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



来源:https://stackoverflow.com/questions/6185982/accessing-command-line-arguments-in-nsis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!