Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSIS multiple if conditions

Tags:

nsis

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?

like image 393
hypheni Avatar asked Jun 18 '15 10:06

hypheni


1 Answers

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...

like image 56
Anders Avatar answered Sep 28 '22 09:09

Anders