@@ -35,6 +35,10 @@ public static class ServiceLayer
3535 /// </summary>
3636 public static OperatingSystems CurrentOperatingSystem = OperatingSystems . All ;
3737 /// <summary>
38+ /// True if the computer is a Mac
39+ /// </summary>
40+ public static bool IsMac = false ;
41+ /// <summary>
3842 /// Used to cancel the current operation. It is set to true when the user clicks the cancel button and it is checked in all long operations to stop them if it is true.
3943 /// </summary>
4044 public static bool Cancel = false ;
@@ -105,6 +109,7 @@ public static bool Initialize(
105109 }
106110 else if ( OperatingSystem . IsMacOS ( ) )
107111 {
112+ IsMac = true ;
108113 if ( RuntimeInformation . ProcessArchitecture == Architecture . Arm64 )
109114 {
110115 CurrentOperatingSystem = OperatingSystems . MacOS_arm64 ;
@@ -344,18 +349,39 @@ public static ExternalTool[] SetExternalTools(string json)
344349 // Set latest version
345350 if ( GeneralConfig . OnlyStableVersions )
346351 {
347- tool . LatestVersion = tool . Versions .
348- Where ( d => d . OperatingSystem == CurrentOperatingSystem &&
349- d . BetaNumber == 0 ) .
350- OrderByDescending ( d => d . VersionNumber ) .
351- FirstOrDefault ( ) ;
352+ if ( tool . Id == "zxbasic" && IsMac )
353+ {
354+ tool . LatestVersion = tool . Versions .
355+ Where ( d => d . OperatingSystem == OperatingSystems . MacOS &&
356+ d . BetaNumber == 0 ) .
357+ OrderByDescending ( d => d . VersionNumber ) .
358+ FirstOrDefault ( ) ;
359+ }
360+ else
361+ {
362+ tool . LatestVersion = tool . Versions .
363+ Where ( d => d . OperatingSystem == CurrentOperatingSystem &&
364+ d . BetaNumber == 0 ) .
365+ OrderByDescending ( d => d . VersionNumber ) .
366+ FirstOrDefault ( ) ;
367+ }
352368 }
353369 if ( tool . LatestVersion == null || ! GeneralConfig . OnlyStableVersions )
354370 {
355- tool . LatestVersion = tool . Versions .
356- Where ( d => d . OperatingSystem == CurrentOperatingSystem ) .
357- OrderByDescending ( d => d . VersionNumber ) .
358- FirstOrDefault ( ) ;
371+ if ( tool . Id == "zxbasic" && IsMac )
372+ {
373+ tool . LatestVersion = tool . Versions .
374+ Where ( d => d . OperatingSystem == OperatingSystems . MacOS ) .
375+ OrderByDescending ( d => d . VersionNumber ) .
376+ FirstOrDefault ( ) ;
377+ }
378+ else
379+ {
380+ tool . LatestVersion = tool . Versions .
381+ Where ( d => d . OperatingSystem == CurrentOperatingSystem ) .
382+ OrderByDescending ( d => d . VersionNumber ) .
383+ FirstOrDefault ( ) ;
384+ }
359385 }
360386
361387 // Path for first versions of ZXBSInstalller
0 commit comments