mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-21 03:04:31 +10:00
macos_installer_handler.py: Add min OS check
Ventura’s installer requires an El Cap host to run
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -518,28 +518,35 @@ class LocalInstallerCatalog:
|
||||
if "CFBundleDisplayName" not in application_info_plist:
|
||||
continue
|
||||
|
||||
app_version = application_info_plist["DTPlatformVersion"]
|
||||
clean_name = application_info_plist["CFBundleDisplayName"]
|
||||
app_version: str = application_info_plist["DTPlatformVersion"]
|
||||
clean_name: str = application_info_plist["CFBundleDisplayName"]
|
||||
app_sdk: str = application_info_plist["DTSDKBuild"] if "DTSDKBuild" in application_info_plist else "Unknown"
|
||||
min_required: str = application_info_plist["LSMinimumSystemVersion"] if "LSMinimumSystemVersion" in application_info_plist else "Unknown"
|
||||
|
||||
if "DTSDKBuild" in application_info_plist:
|
||||
app_sdk = application_info_plist["DTSDKBuild"]
|
||||
else:
|
||||
app_sdk = "Unknown"
|
||||
kernel: int = 0
|
||||
try:
|
||||
kernel = int(app_sdk[:2])
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
min_required = os_data.os_conversion.os_to_kernel(min_required) if min_required != "Unknown" else "Unknown"
|
||||
|
||||
if isinstance(min_required, int):
|
||||
if min_required == os_data.os_data.sierra and kernel == os_data.os_data.ventura:
|
||||
# Ventura's installer requires El Capitan minimum
|
||||
# Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/discussions/1038
|
||||
min_required = os_data.os_data.el_capitan
|
||||
|
||||
# app_version can sometimes report GM instead of the actual version
|
||||
# This is a workaround to get the actual version
|
||||
if app_version.startswith("GM"):
|
||||
try:
|
||||
app_version = int(app_sdk[:2])
|
||||
if app_version < 20:
|
||||
app_version = f"10.{app_version - 4}"
|
||||
else:
|
||||
app_version = f"{app_version - 9}.0"
|
||||
except ValueError:
|
||||
if kernel == 0:
|
||||
app_version = "Unknown"
|
||||
else:
|
||||
app_version = os_data.os_conversion.kernel_to_os(kernel)
|
||||
|
||||
# Check if App Version is High Sierra or newer
|
||||
if os_data.os_conversion.os_to_kernel(app_version) < os_data.os_data.high_sierra:
|
||||
if kernel < os_data.os_data.high_sierra:
|
||||
continue
|
||||
|
||||
results = self._parse_sharedsupport_version(Path(APPLICATION_SEARCH_PATH) / Path(application)/ Path("Contents/SharedSupport/SharedSupport.dmg"))
|
||||
@@ -554,6 +561,7 @@ class LocalInstallerCatalog:
|
||||
"Version": app_version,
|
||||
"Build": app_sdk,
|
||||
"Path": application,
|
||||
"Minimum Host OS": min_required,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user