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

Syntax

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

Description

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.

Examples

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

See also

FileExists