It is currently Tue Mar 09, 2021 9:54 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: OSVersion() on MacOS 11.1 Big Sur returns wrong ID
PostPosted: Sun Dec 20, 2020 5:18 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1814
Location: Germany
On MacOS 11.1 'Big Sur' OSVersion() in PB 5.73 incorrectly returns the ID of MacOS 10.9 'Mavericks':
Code:
Debug #PB_OS_MacOSX_10_9   ; 10900
Debug #PB_OS_MacOSX_Future ; 60000
Debug OSVersion()          ; 10900

Furthermore the constants #PB_OS_MacOSX_10_15 (Catalina) and #PB_OS_MacOSX_11 (Big Sur) are still missing.

You may use this workaround to get the major and minor version of your current MacOS which is compatible down to MacOS 10.2. There are newer methods available but they require at least MacOS 10.10 'Yosemite'!
Code:
Procedure.S GetMacOSMajorAndMinorVersion()
  Protected MacOSVersion.S

  MacOSVersion = StringField(PeekS(CocoaMessage(0, CocoaMessage(0,
    CocoaMessage(0, 0, "NSProcessInfo processInfo"),
    "operatingSystemVersionString"), "UTF8String"), -1, #PB_UTF8), 2, " ")

  ProcedureReturn StringField(MacOSVersion, 1, ".") + "." +
    StringField(MacOSVersion, 2, ".")
EndProcedure

MessageRequester("Info", "MacOS version: " + GetMacOSMajorAndMinorVersion())


You should also be aware that Apple changed its release numbering policy with Big Sur:
This is the first release since Mac OS 9 where point releases increment the second component of the release number, unlike prior releases where point releases incremented the third component of the release number and major releases increments the second component of the release number.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye