NSIS-How to send the parameter from command line to nsi file
Asked Answered
D

1

5

I am new to NSIS script. I want to send the version number to my test.nsi file but it does not work. Inside my test.nsi file, the value of version is: test.nsi. What is the correct syntax for this command?

"C:\Program Files\NSIS\makensis.exe" -DVERSION=1.2.1 test.nsi

thanks,

Jdang

Dermoid answered 3/11, 2011 at 21:26 Comment(0)
S
8

The documentation is quite clear

http://nsis.sourceforge.net/Docs/Chapter3.html

You should be using a / rather than a - to prefix the parameter name so your command becomes

"C:\Program Files\NSIS\makensis.exe" /DVERSION=1.2.1 test.nsi
Stefansson answered 3/11, 2011 at 21:43 Comment(6)
I tried that option but inside the test.nsi file, I still see the value of !echo $VERSION equals test.nsiDermoid
I tried that option but inside the test.nsi file, I still see the value of !echo $VERSION equals test.nsi. What is the correct syntax to reference to VERSION variable in this case? $VERSION ??Dermoid
To reference the version value inside test.nsi file you should be using ${VERSION} and not $VERSION as it is a "define" and not a variableStefansson
Make certain that your .NSI file reference is the last parameter on the command line.Guttural
@BrettVeenstra You have no idea how long I spent on a problem before trying your solution. Thank you thank you for that little tidbit that I will never forget :-) I didn't realize the order mattered in the call.Hudson
@PaulHunt Could you please add information about `${VERSION}' in you answer? It will be more helpful:)Publication

© 2022 - 2024 — McMap. All rights reserved.