From 334c0906d0a852a7647b6e0a5cdc403209ac3573 Mon Sep 17 00:00:00 2001 From: Headshotnoby Date: Tue, 22 Jun 2021 14:48:23 -0400 Subject: [PATCH] :fuck_off_xcode: --- AO2XP.py | 2 ++ updater.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/AO2XP.py b/AO2XP.py index 9b7d2d4..0f11f3a 100644 --- a/AO2XP.py +++ b/AO2XP.py @@ -84,6 +84,8 @@ if not debugmode: if code == 0: subprocess.Popen(["./AO2XPupdat"]) os._exit(0) + elif osname == "Darwin" and ".app" in sys.argv[0]: # bundle + os.chdir(path) # return to Resources folder import gameview, mainmenu, options diff --git a/updater.py b/updater.py index 8c7dddb..26ca92c 100644 --- a/updater.py +++ b/updater.py @@ -144,6 +144,11 @@ class updateThread(QtCore.QThread): self.finished.emit() return + path = sys.argv[0] + if platform.system() == "Darwin" and ".app" in path: # bundle + path = "/".join(path.split("/")[:-4]) # right next to the .app package + os.chdir(path) + updatezip = "update" + os.path.splitext(filename)[1] if not os.path.exists(updatezip): downloadfile = open(updatezip, "wb")