SystemInformationMBS isn't recognizing newer macOS versions (11+) versus 10.xx versions

The following check is returning true on all tested macOS versions here under the latest Xojo resulting in the first value always being assigned. Issue with Xojo, my code, or MBS 22.5?

If SystemInformationMBS.isHighSierra Or SystemInformationMBS.isSierra Or SystemInformationMBS.isElCapitan Then
  helpers = App.ExecutableFile.Parent.Parent.Child("Resources").Child("ABMacHelpersIntel-10.13.tgz")
Else
  helpers = App.ExecutableFile.Parent.Parent.Child("Resources").Child("ABMacHelpers.tgz")
End If

It’s an issue with your code. IsHighSierra means that the macOS version is at least High Sierra which is true. If you want an exact comparison then you need to use another function.

1 Like

Well, it is

isHighSierra(orHigher as boolean = true) as boolean

so you could just add (false) there as parameter.

or maybe just swap the order:

If SystemInformationMBS.isMojave Then
  helpers = App.ExecutableFile.Parent.Parent.Child("Resources").Child("ABMacHelpers.tgz")
Else
  helpers = App.ExecutableFile.Parent.Parent.Child("Resources").Child("ABMacHelpersIntel-10.13.tgz")
End If
3 Likes

Oh, I never noticed the parameter.

Or just use the built-in system.version class.

1 Like

I find the MBS version much easier to use.

1 Like

Like Beatrix, I didn’t know about the parameter. However, knowing that it’s not a single platform check and using the IsMojave check solves my problem wonderfully :slight_smile:

1 Like

FWIW, I find the name confusing. IsMojave returning true for Catalina, even if you have a parameter to make the comparison matching exactly, just seems incorrectly named.

That is strange. What does MacMajorVersion and MacMinorVersion report?

Because IsMojave(False) just checks if major = 10 and minor = 14.

Don’t forget that Big Sur reports 11.0 on Apple Silicon and 10.16 on Intel. System.Version compensates for that.

1 Like

Was this question intended to be targeting me?
There’s nothing strange, except the name. What I’m saying is when the parameter is omitted (or true), the function “IsMojave” is badly named, as Catalina isn’t Mojave (but the call returns true).

Well, the True parameter is for “…or better”. I might have once been similarly puzzled by this because the parameter is optional and True the default. But once I RTFM, it all clicked. :slight_smile:

1 Like

I used Ohanaware App Kit till very recently. DesktopControls broke OAK and I had made the decision to update. Sam had methods like …isAtLeastMojave, etc. that are perhaps named more intuitively. But here you can pass False if you want “just” Mojave. I’ve gotten used to it.

1 Like

I agree that passing the False parameter solves this, but I would have made False the default and you then pass True for “… or later” :thinking:

1 Like

Since MBS can’t change the default now to “false” (as this would break existing code without developers being aware), it could be changed to be a required parameter.

Then the Developers would need to specify what they want/need (without parameter it’s a compile error).
And by changing it to required it would even force to re-think every usage of this… by adding the intended Parameter. It’s even backwards compatible.

2 Likes

I create my own functions to do this, and name them like this:

  • function macOSVersionIsHighSierraOrLater() as boolean
  • function macOSVersionIsCatalinaOrLater() as boolean
  • function macOSVersionIsVenturaOrLater() as boolean
    etc.

Wordy, but I think the meaning is very clear.

2 Likes

Granted. Missing the optional parameter is one thing (in which I also get caught once). But even if the parameter was required, it wouldn’t make the name of the function more appropriate :wink:

Agreed.

The issue in my original post was that I was expecting the “False” argument to be the default so that “IsHighSierra” only returned true if the OS version was High Sierra. Now that I know that there’s a parameter to change the behavior to what I expected, I’m all good.