Search code examples
installationnsis

Can NSIS scripts add 2 integers & 'OR' a StrCmp


Is it possible to add 2 numbers together in Native NSIS(not using libraries)?

Var hasVersion9    # values will either be 0 or 1
Var hasVersion10
Var hasVersion9Or10

IntCpy $hasVersion9Or10 hasVersion9+hasVersion10
(IntCmp $hasVersion9Or10 1 OR IntCmp $hasVersion9Or10 2) doThis doThat

Is it also possible to perform an 'Or' operation in a string comparision?

StrCmp $myVar ("1" OR "11") doThis doThat

Solution

  • Use IntOp for number operations and the logiclib for if/orif