ifdef, ifndef, ifexsist, ifnexist directives

Inno Setup Preprocessor

ifdef, ifndef, ifexsist, ifnexist directives

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 identifier has been defined, and it is equivalent to if 0 when 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 function