inno-setup

Require minimum Inno Setup compiler version


I was wondering whether it's possible to print a custom error message in case someone tries to compile an .iss file with an unsupported Inno Setup version. This would be more helpful than for example having the compiler tell you "the WizardStyle directive isn't known" (or something like that). I've checked the "constants" section of the documentation, but couldn't find the compiler version number there.


Solution

  • Use preprocessor and its Ver predefined variable and #if and #error directives. Actually the documentation of the #error directive shows exactly the code you need:

    #if VER < EncodeVer(5,4,2)
      #error A more recent version of Inno Setup is required to compile this script (5.4.2 or newer)
    #endif