Can I implement the following C code inside NSIS script?
C code
if ( (value1 == 1) && ((value2 == "text") || (value3 >= 100)) )
//Do something
NSIS code
${If} $value2 == "text"
${OrIf} $value3 >= 100
But I don't think on the above condition I can add another ${AndIf}
statement. Instead I need to do the following:
${If} $value1 == 1
${If} $value2 == "text"
${OrIf} $value3 >= 100
//Condition success
${EndIf}
${Else}
//Conditon failed
${EndIf}
Am I correct or is there any better way to do it?
Combining ${OrIf}
and ${AndIf}
in one statement will give you undefined results, you need to nest the if statements. I don't know of a better way...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With