mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 12:00:15 +10:00
GUI: Replace app after checking updates
This commit is contained in:
@@ -183,10 +183,7 @@ class wx_python_gui:
|
|||||||
self.popup.ShowModal()
|
self.popup.ShowModal()
|
||||||
else:
|
else:
|
||||||
# Spawn thread to check for updates
|
# Spawn thread to check for updates
|
||||||
if self.check_for_local_installs() is True:
|
threading.Thread(target=self.check_for_updates).start()
|
||||||
self.OnCloseFrame()
|
|
||||||
else:
|
|
||||||
threading.Thread(target=self.check_for_updates).start()
|
|
||||||
|
|
||||||
def check_for_local_installs(self, event=None):
|
def check_for_local_installs(self, event=None):
|
||||||
# Update app in '/Library/Application Support/Dortania' folder
|
# Update app in '/Library/Application Support/Dortania' folder
|
||||||
@@ -276,14 +273,16 @@ class wx_python_gui:
|
|||||||
|
|
||||||
subprocess.run(["xattr", "-cr", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
subprocess.run(["xattr", "-cr", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
subprocess.run(["open", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
subprocess.run(["open", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
subprocess.run(["rm", "-R", path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
if "AppTranslocation" not in path:
|
||||||
|
subprocess.run(["rm", "-R", path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
return True
|
self.OnCloseFrame()
|
||||||
|
|
||||||
def check_for_updates(self, event=None):
|
def check_for_updates(self, event=None):
|
||||||
if self.constants.has_checked_updates is True:
|
if self.constants.has_checked_updates is True:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
did_find_update = False
|
||||||
ignore_updates = global_settings.global_settings().read_property("IgnoreAppUpdates")
|
ignore_updates = global_settings.global_settings().read_property("IgnoreAppUpdates")
|
||||||
if ignore_updates is not True:
|
if ignore_updates is not True:
|
||||||
self.constants.ignore_updates = False
|
self.constants.ignore_updates = False
|
||||||
@@ -302,6 +301,7 @@ class wx_python_gui:
|
|||||||
)
|
)
|
||||||
self.dialog.SetYesNoCancelLabels("View on Github", "Always Ignore", "Ignore Once")
|
self.dialog.SetYesNoCancelLabels("View on Github", "Always Ignore", "Ignore Once")
|
||||||
response = self.dialog.ShowModal()
|
response = self.dialog.ShowModal()
|
||||||
|
did_find_update = True
|
||||||
if response == wx.ID_YES:
|
if response == wx.ID_YES:
|
||||||
webbrowser.open(github_link)
|
webbrowser.open(github_link)
|
||||||
elif response == wx.ID_NO:
|
elif response == wx.ID_NO:
|
||||||
@@ -312,6 +312,9 @@ class wx_python_gui:
|
|||||||
self.constants.ignore_updates = True
|
self.constants.ignore_updates = True
|
||||||
print("- Ignoring App Updates due to defaults")
|
print("- Ignoring App Updates due to defaults")
|
||||||
|
|
||||||
|
if did_find_update is False:
|
||||||
|
self.check_for_local_installs()
|
||||||
|
|
||||||
def relaunch_as_root(self, event=None):
|
def relaunch_as_root(self, event=None):
|
||||||
|
|
||||||
# Add Dialog Box asking if it's ok to relaunch as root
|
# Add Dialog Box asking if it's ok to relaunch as root
|
||||||
|
|||||||
Reference in New Issue
Block a user