From 84a74f804dee3a7b020faab5ba493780156181e3 Mon Sep 17 00:00:00 2001 From: neox95 Date: Wed, 10 Jul 2019 01:23:48 +0200 Subject: [PATCH] Minor changes --- VERSIONS.LST | 2 +- src/updater.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/VERSIONS.LST b/VERSIONS.LST index 420bd0b..04e5cbb 100644 --- a/VERSIONS.LST +++ b/VERSIONS.LST @@ -1,2 +1,2 @@ # ver|url|checksum, and | as separator, one version per || -3.0.1|https://github.com/neox95/CNIRevelator/releases/download/3.0.1-pre-alpha/CNIRevelator.zip|FIaHzUzgi7Lqmad7md9bzsvbdx4=|| +3.0.1|https://github.com/neox95/CNIRevelator/releases/download/3.0.1-pre-alpha/CNIRevelator.zip|148687cd4ce08bb2ea99a77b99df5bcecbdb771e|| diff --git a/src/updater.py b/src/updater.py index 2172d59..80b0f40 100644 --- a/src/updater.py +++ b/src/updater.py @@ -121,6 +121,7 @@ def batch(): if sum > finalsum: finalver = ver.copy() finalurl = url + finalchecksum = checksum if finalver == globs.version: logfile.printdbg('The software is already the newer version') @@ -141,8 +142,13 @@ def batch(): if not data: break sha1.update(data) + + check = sha1.hexdigest() + logfile.printdbg("SHA1: {0}".format(check)) - logfile.printdbg("SHA1: {0}".format(sha1.hexdigest())) + if not check == finalchecksum: + logfile.printerr("Checksum error") + return False # And now unzip and launch logfile.printdbg("Unzipping the package") @@ -150,6 +156,8 @@ def batch(): zip_ref.extractall(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full)) zip_ref.close() + logfile.printdbg(globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + '\\CNIRevelator.exe') + args = [globs.CNIRFolder + '\\..\\CNIRevelator' + str(globs.verstring_full) + '\\CNIRevelator.exe', globs.CNIRFolder] subprocess.run(args)