Checking the compiler version in a script file

56 views
Skip to first unread message

Martin Reinders

unread,
Jun 14, 2024, 12:27:07 AMJun 14
to inno...@googlegroups.com
Hi everyone,

Is it possible to ensure that a script file is processed by a minimum version of Inno Setup, such as "6.3 or better"?

It seems that there is no directive for that purpose, but perhaps I overlooked it.

Background:

I just updated to Inno Setup 6.3.1 on my computer and removed the UTF-8 byte order marker from the script file.

If the product is built by a coworker on a different computer where Inno Setup is not yet updated, the UTF-8 script file would be interpreted as ANSI and the result would be wrong.

I know, in this particular situation (upgrade from 6.2 to 6.3) the ArchitecturesAllowed will be changed in a backward incompatible way (e.g. "x64" to "x64compatible") which means that an older Inno Setup compiler fails to compile the script.

But still: checking for the compiler versions seems a useful feature to me, and I wonder if that is possible.

Best regards,
Martin

Martijn Laan

unread,
Jun 14, 2024, 12:37:13 AMJun 14
to innosetup
Try this:

#if Ver < EncodeVer(6, 3, 0)
#error Your version is cool but 6.3 is better!
#endif

Greetings,
Martijn

Op vrijdag 14 juni 2024 om 06:27:07 UTC+2 schreef Martin Reinders:

Gavin Lambert

unread,
Jun 14, 2024, 12:38:33 AMJun 14
to innosetup
On Friday, June 14, 2024 at 4:27:07 PM UTC+12 Martin Reinders wrote:
Is it possible to ensure that a script file is processed by a minimum version of Inno Setup, such as "6.3 or better"?

Yes, ISPP can be used to enforce that:

#if Ver < 0x06010200
  #error Requires Inno Setup v6.1.2 to compile.
#endif

Martin Reinders

unread,
Jun 14, 2024, 1:33:09 AMJun 14
to innosetup
Thanks, Martijn and Gavin, that is perfect.

Martin
Reply all
Reply to author
Forward
0 new messages