macos_installer_handler.py: Add min OS check

Ventura’s installer requires an El Cap host to run
This commit is contained in:
Mykola Grymalyuk
2023-04-28 14:50:59 -06:00
parent c668ac0004
commit 6fca3339fc
4 changed files with 41 additions and 18 deletions

View File

@@ -2060,7 +2060,17 @@ class wx_python_gui:
logging.info("Installer(s) found:")
for app in available_installers:
logging.info(f"- {available_installers[app]['Short Name']}: {available_installers[app]['Version']} ({available_installers[app]['Build']})")
self.install_selection = wx.Button(self.frame, label=f"{available_installers[app]['Short Name']}: {available_installers[app]['Version']} ({available_installers[app]['Build']})", size=(320, 30))
app_str = f"{available_installers[app]['Short Name']}"
unsupported: bool = available_installers[app]['Minimum Host OS'] > self.constants.detected_os
if unsupported:
min_str = os_data.os_conversion.convert_kernel_to_marketing_name(available_installers[app]['Minimum Host OS'])
app_str += f" (Requires {min_str})"
else:
app_str += f": {available_installers[app]['Version']} ({available_installers[app]['Build']})"
self.install_selection = wx.Button(self.frame, label=app_str, size=(320, 30))
i = i + 25
self.install_selection.SetPosition(
wx.Point(
@@ -2070,6 +2080,9 @@ class wx_python_gui:
)
self.install_selection.Bind(wx.EVT_BUTTON, lambda event, temp=app: self.format_usb_menu(available_installers[temp]['Short Name'], available_installers[temp]['Path']))
self.install_selection.Centre(wx.HORIZONTAL)
if unsupported:
self.install_selection.Disable()
else:
logging.info("No installers found")
# Label: No Installers Found