Skip to content
⌘ NSIS Forum Archive

Check for command line parameter

2 posts

Struct#

Check for command line parameter

Hello 🙂

If I install my application by command line, the user can set a parameter called Matto in this way:

COMMANDLINE: myapp.exe /S -Matto=true

${GetParameters} $R0
${GetOptions} $R0 "-Matto=" $MattoIsSet
pop $MattoIsSet

---

Is it possible to check only if the parameter is set without a value? For example:

COMMANDLINE: myapp.exe /S -Matto

And in my script I can now check if the user have typed -Matto or not
Afrow UK#

${GetParameters} $R0
${GetOptions} $R0 "-Matto" $MattoIsSet
${If} ${NotErrors}
${AndIf} $MattoIsSet == ""
...
Stu