How to determine version of macOS

this is for Xojo2019r1.1 so the new system functions are not available

previously I was using

Call System.Gestalt("sys1", sysMajorVersion)
Call System.Gestalt("sys2", sysMinorVersion)
Call System.Gestalt("sys3", sysBugVersion)

but two things wrong here.

  1. it was deprecated in Xojo2014 (and still ‘works’…kinda)
  2. returns incorrect “sysMajor” for BigSur and beyond (still returns 10, not 11, 12 etc

there’s a better one in my Kitchen Sink project
You can peruse that online
What you want is in KitchenSink/PlatformUtilities.xojo_code at main · npalardy/KitchenSink · GitHub
The Initialize method + one structure, OSVersionInfo, for the declares to use

What‽ We’re not supposed to parse operatingSystemVersionString? Who’d have guessed?

1 Like

That’s expected and by Apple’s design.

This Xojo version obviously doesn’t link against current SDK’s, so you’re expected to get 10.16.

For both deprecated Gestalt, as well as the Declares to get the operatingSystemVersion.

https://developer.apple.com/forums/thread/713444