Reference/!ifndef

From NSIS Wiki
Jump to navigationJump to search

!ifndef

gflag [bcheck gflag [...]]]

The opposite of !ifdef. The lines will be compiled when the gflag(s) have not been defined.

!define SOMETHING
!ifdef SOMETHING
  !echo "SOMETHING is defined"
!endif
 
!undef SOMETHING
!ifndef SOMETHING
  !echo "SOMETHING is NOT defined"
!endif
 
!define SOMETHINGELSE
!ifdef SOMETHING | SOMETHINGELSE | SOMEOTHERTHING
  !echo "At least one of SOMETHING, SOMETHINGELSE, or SOMEOTHERTHING is defined"
!endif
 
!ifndef SOMETHING | SOMETHINGELSE | SOMEOTHERTHING
  !echo "At least one of SOMETHING, SOMETHINGELSE, or SOMEOTHERTHING is NOT defined"
!endif
 
!undef SOMETHINGELSE
!ifndef SOMETHING & SOMETHINGELSE & SOMEOTHERTHING
  !echo "SOMETHING, SOMETHINGELSE, and SOMEOTHERTHING are all NOT defined"
!endif