Enhancing update system

This commit is contained in:
Adrien Bourmault 2019-07-10 11:47:54 +02:00 committed by GitHub
parent 43dfc7b812
commit 9daa095665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -69,5 +69,8 @@ except Exception:
logfile.printerr("A FATAL ERROR OCCURED : " + str(traceback.format_exc()))
sys.exit(1)
if updater.UPDATE_IS_MADE:
sys.exit(0)
main()
sys.exit(0)

View File

@ -38,6 +38,8 @@ import globs # globs.py
import ihm # ihm.py
import downloader # downloader.py
UPDATE_IS_MADE = False
def createShortcut(path, target='', wDir='', icon=''):
ext = path[-3:]
if ext == 'url':
@ -175,15 +177,19 @@ def batch():
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('Success !'))
# Cleanup
try:
os.remove(globs.CNIRFolder + '\\..\\CNIPackage.zip')
except:
pass
# Launch app !
args = [UPATH + '\\CNIRevelator.exe', globs.CNIRFolder]
subprocess.Popen(args)
launcherWindow.mainCanvas.itemconfigure(launcherWindow.msg, text=('Launched the new process.'))
launcherWindow.destroy()
sys.exit(0)
return
UPDATE_IS_MADE = True
return True
## Main Function
def umain():