Skip to content
⌘ NSIS Forum Archive

A question regarding !if

3 posts

JohnChen#

A question regarding !if

It looks like outside section, we can only use !if instead of ${If}. But if I use !if outside of section like,

!if $promise == "true"
; win a million dollars
!else
; lose a million dollars

Within onInit, I already set $promise to be "true". However when the code above is run, it always goes to !else. It looks like $promise hasn't been got a chance to be set. Why? Thanks.
Anders#
$promise is a variable, it can only be used at runtime (inside functions and sections)

use !define's ( ${foo} ) with !if / !ifdef