mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-19 05:40:01 +10:00
Only list newest installers by default
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
- Grey out return buttons while performing sensitive tasks
|
- Grey out return buttons while performing sensitive tasks
|
||||||
- Add `Currently Booted SIP` info to SIP Settings
|
- Add `Currently Booted SIP` info to SIP Settings
|
||||||
- Add Disk Highlighting during Build/Install for previously installed disks
|
- Add Disk Highlighting during Build/Install for previously installed disks
|
||||||
|
- Only list newest installers by default (reload to show older binaries)
|
||||||
- Remove manual root unpatching
|
- Remove manual root unpatching
|
||||||
- Removed due to reliablity issues
|
- Removed due to reliablity issues
|
||||||
- `bless` based reversion still supported in Big Sur+
|
- `bless` based reversion still supported in Big Sur+
|
||||||
|
|||||||
+27
-8
@@ -1102,7 +1102,7 @@ class wx_python_gui:
|
|||||||
|
|
||||||
self.frame.SetSize(self.WINDOW_WIDTH_MAIN, self.return_to_main_menu.GetPosition().y + self.return_to_main_menu.GetSize().height + 40)
|
self.frame.SetSize(self.WINDOW_WIDTH_MAIN, self.return_to_main_menu.GetPosition().y + self.return_to_main_menu.GetSize().height + 40)
|
||||||
|
|
||||||
def grab_installer_data(self, event=None):
|
def grab_installer_data(self, event=None, ias=None):
|
||||||
self.frame.DestroyChildren()
|
self.frame.DestroyChildren()
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
@@ -1136,7 +1136,12 @@ class wx_python_gui:
|
|||||||
wx.GetApp().Yield()
|
wx.GetApp().Yield()
|
||||||
|
|
||||||
# Download installer catalog
|
# Download installer catalog
|
||||||
available_installers = installer.list_downloadable_macOS_installers(self.constants.payload_path, "PublicSeed")
|
if ias is None:
|
||||||
|
print("- Downloading installer catalog...")
|
||||||
|
available_installers = installer.list_downloadable_macOS_installers(self.constants.payload_path, "PublicSeed")
|
||||||
|
else:
|
||||||
|
print("- Using existing installer catalog...")
|
||||||
|
available_installers = ias
|
||||||
|
|
||||||
self.frame.DestroyChildren()
|
self.frame.DestroyChildren()
|
||||||
|
|
||||||
@@ -1156,13 +1161,12 @@ class wx_python_gui:
|
|||||||
)
|
)
|
||||||
self.subheader.Centre(wx.HORIZONTAL)
|
self.subheader.Centre(wx.HORIZONTAL)
|
||||||
|
|
||||||
|
available_installers_backup = available_installers.copy()
|
||||||
# Sort Installers by 'Version'
|
|
||||||
# By default Apple adds new builds to the end of the list, so we need to sort them by version
|
|
||||||
available_installers = {k: v for k, v in sorted(available_installers.items(), key=lambda x: x[1]['Version'])}
|
|
||||||
|
|
||||||
i = -20
|
i = -20
|
||||||
if available_installers:
|
if available_installers:
|
||||||
|
if ias is None:
|
||||||
|
available_installers = installer.only_list_newest_installers(available_installers)
|
||||||
for app in available_installers:
|
for app in available_installers:
|
||||||
print(f"macOS {available_installers[app]['Version']} ({available_installers[app]['Build']} - {utilities.human_fmt(available_installers[app]['Size'])} - {available_installers[app]['Source']}) - {available_installers[app]['Variant']}")
|
print(f"macOS {available_installers[app]['Version']} ({available_installers[app]['Build']} - {utilities.human_fmt(available_installers[app]['Size'])} - {available_installers[app]['Source']}) - {available_installers[app]['Variant']}")
|
||||||
if available_installers[app]['Variant'] in ["DeveloperSeed" , "PublicSeed"]:
|
if available_installers[app]['Variant'] in ["DeveloperSeed" , "PublicSeed"]:
|
||||||
@@ -1191,11 +1195,23 @@ class wx_python_gui:
|
|||||||
self.install_selection.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))
|
self.install_selection.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))
|
||||||
self.install_selection.Centre(wx.HORIZONTAL)
|
self.install_selection.Centre(wx.HORIZONTAL)
|
||||||
|
|
||||||
|
self.load_all_installers = wx.Button(self.frame, label="Reload with all installers")
|
||||||
|
self.load_all_installers.SetPosition(
|
||||||
|
wx.Point(
|
||||||
|
self.install_selection.GetPosition().x,
|
||||||
|
self.install_selection.GetPosition().y + self.install_selection.GetSize().height + 7
|
||||||
|
)
|
||||||
|
)
|
||||||
|
self.load_all_installers.Bind(wx.EVT_BUTTON, lambda event: self.reload_macos_installer_catalog(ias=available_installers_backup))
|
||||||
|
self.load_all_installers.Centre(wx.HORIZONTAL)
|
||||||
|
if ias or not available_installers:
|
||||||
|
self.load_all_installers.Disable()
|
||||||
|
|
||||||
self.return_to_main_menu = wx.Button(self.frame, label="Return to Main Menu")
|
self.return_to_main_menu = wx.Button(self.frame, label="Return to Main Menu")
|
||||||
self.return_to_main_menu.SetPosition(
|
self.return_to_main_menu.SetPosition(
|
||||||
wx.Point(
|
wx.Point(
|
||||||
self.install_selection.GetPosition().x,
|
self.load_all_installers.GetPosition().x,
|
||||||
self.install_selection.GetPosition().y + self.install_selection.GetSize().height + 10
|
self.load_all_installers.GetPosition().y + self.load_all_installers.GetSize().height + 5
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.return_to_main_menu.Bind(wx.EVT_BUTTON, self.main_menu)
|
self.return_to_main_menu.Bind(wx.EVT_BUTTON, self.main_menu)
|
||||||
@@ -1203,6 +1219,9 @@ class wx_python_gui:
|
|||||||
|
|
||||||
self.frame.SetSize(self.WINDOW_WIDTH_MAIN, self.return_to_main_menu.GetPosition().y + self.return_to_main_menu.GetSize().height + 40)
|
self.frame.SetSize(self.WINDOW_WIDTH_MAIN, self.return_to_main_menu.GetPosition().y + self.return_to_main_menu.GetSize().height + 40)
|
||||||
|
|
||||||
|
def reload_macos_installer_catalog(self, event=None, ias=None):
|
||||||
|
self.grab_installer_data(ias=ias)
|
||||||
|
|
||||||
def download_macos_click(self, installer_name, installer_link):
|
def download_macos_click(self, installer_name, installer_link):
|
||||||
self.frame.DestroyChildren()
|
self.frame.DestroyChildren()
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,56 @@ def list_downloadable_macOS_installers(download_path, catalog):
|
|||||||
})
|
})
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
available_apps = {k: v for k, v in sorted(available_apps.items(), key=lambda x: x[1]['Version'])}
|
||||||
|
return available_apps
|
||||||
|
|
||||||
|
def only_list_newest_installers(available_apps):
|
||||||
|
# Takes a dictionary of available installers
|
||||||
|
# Returns a dictionary of only the newest installers
|
||||||
|
# This is used to avoid overwhelming the user with installer options
|
||||||
|
|
||||||
|
# Only strip OSes that we know are supported
|
||||||
|
supported_versions = ["10.13", "10.14", "10.15", "11", "12"]
|
||||||
|
|
||||||
|
for version in supported_versions:
|
||||||
|
remote_version_minor = 0
|
||||||
|
remote_version_security = 0
|
||||||
|
|
||||||
|
# First determine the largest version
|
||||||
|
for ia in available_apps:
|
||||||
|
if available_apps[ia]["Version"].startswith(version):
|
||||||
|
if available_apps[ia]["Variant"] not in ["DeveloperSeed", "PublicSeed"]:
|
||||||
|
remote_version = available_apps[ia]["Version"].split(".")
|
||||||
|
if remote_version[0] == "10":
|
||||||
|
remote_version.pop(0)
|
||||||
|
remote_version.pop(0)
|
||||||
|
else:
|
||||||
|
remote_version.pop(0)
|
||||||
|
if int(remote_version[0]) > remote_version_minor:
|
||||||
|
remote_version_minor = int(remote_version[0])
|
||||||
|
if len(remote_version) > 1:
|
||||||
|
if int(remote_version[1]) > remote_version_security:
|
||||||
|
remote_version_security = int(remote_version[1])
|
||||||
|
|
||||||
|
# Now remove all versions that are not the largest
|
||||||
|
for ia in list(available_apps):
|
||||||
|
if available_apps[ia]["Version"].startswith(version):
|
||||||
|
remote_version = available_apps[ia]["Version"].split(".")
|
||||||
|
if remote_version[0] == "10":
|
||||||
|
remote_version.pop(0)
|
||||||
|
remote_version.pop(0)
|
||||||
|
else:
|
||||||
|
remote_version.pop(0)
|
||||||
|
if int(remote_version[0]) < remote_version_minor:
|
||||||
|
available_apps.pop(ia)
|
||||||
|
elif int(remote_version[0]) == remote_version_minor:
|
||||||
|
if len(remote_version) > 1:
|
||||||
|
if int(remote_version[1]) < remote_version_security:
|
||||||
|
available_apps.pop(ia)
|
||||||
|
else:
|
||||||
|
if remote_version_security > 0:
|
||||||
|
available_apps.pop(ia)
|
||||||
|
|
||||||
return available_apps
|
return available_apps
|
||||||
|
|
||||||
def format_drive(disk_id):
|
def format_drive(disk_id):
|
||||||
|
|||||||
Reference in New Issue
Block a user