Inno Setup Preprocessor: #ifdef, #ifndef, #ifexist, #ifnexist


ifdef-directive: ifdef <ident>
ifndef-directive: ifndef <ident>
ifexist-directive: ifexist <expr>
ifnexist-directive: ifnexist <expr>


You can use the ifdef, ifndef, ifexist, and ifnexist directives anywhere if can be used. The ifdef identifier statement is equivalent to if 1 when the specified identifier has been defined, and equivalent to if 0 when the identifier has not been defined or has been undefined with the undef directive. These directives check only for the presence or absence of identifiers defined with define.

ifexist and ifnexist directives check for presence and absence of the file, respectively.


#ifexist "myfile.ext"
  Filename: "myfile.ext"; DestDir: {app}
#ifdef Enterpise
  Filename: "extra.dll"; DestDir: {app}

See also