do base folder backup in updater.py

This commit is contained in:
Headshotnoby 2021-06-22 20:15:25 -04:00
parent 4097451216
commit 161535e40a
2 changed files with 2 additions and 2 deletions

View File

@ -83,8 +83,6 @@ if not debugmode:
code = updater.checkForUpdates(force_update) code = updater.checkForUpdates(force_update)
if code == 0: if code == 0:
subprocess.Popen(["./AO2XPupdat"]) subprocess.Popen(["./AO2XPupdat"])
if platform.system() == "Darwin" and ".app" in sys.argv[0]: # bundle
os.system("mv "+path+"/base ./appbase") # move the base folder out of the app folder to avoid deletion
os._exit(0) os._exit(0)
elif osname == "Darwin" and ".app" in sys.argv[0]: # bundle elif osname == "Darwin" and ".app" in sys.argv[0]: # bundle
os.chdir(path) # return to Resources folder os.chdir(path) # return to Resources folder

View File

@ -186,6 +186,8 @@ class updateThread(QtCore.QThread):
print "downloaded update" print "downloaded update"
downloadfile.close() downloadfile.close()
if platform.system() == "Darwin" and ".app" in sys.argv[0]: # bundle
os.system("cp -r "+path+"/base ./appbase") # move the base folder out of the app folder to avoid deletion
returncode = 0 returncode = 0
else: else:
returncode = -2 returncode = -2