zanz
23rd July 2008 22:50 UTC
If, OR and AND statements
I'm new to NSIS (still - it's been a few days now) and I'm coming from Java/C# background. I find it hard to write syntax in NSIS script...the user manual also assumes some user knowledge. I'm not really sure what's the best way to find answers to common things.
For example,
If just need to have an if condition with OR combination.
in C# it's simple:
if(string 1 || string2 || string3|
{
do something here
}
else
{
do something here
}
What's an equivalent for the above snippet in NSIS? The manual doesn't really anything regarding the If-else-OR-AND statements. Please help.
LoRd_MuldeR
23rd July 2008 22:54 UTC
There is no "native" support in NSIS, but LogicLib can be useful:
See the comments in this file for info:
NSIS\Include\LogicLib.nsh
There are also some useful pre-processor instructions available (!if, !else and !endif).
See "5.1 Compiler Utility Commands" for more info...
Sheik
23rd July 2008 23:10 UTC
Definitely look at LogicLib
It is exactly what you want, and has the syntax you are looking for.
Personally, I still feel that NSIS should just merge LogicLib into the base of NSIS.
That way we can just use If and And, instead of ${If}, ${And}, and the like.
zanz
23rd July 2008 23:23 UTC
Thanks, it was helpful...
I'd agree on merging LogicLig to at least in the knowledge, it was all the essentials for the beginners.