Minor changes

This commit is contained in:
Adrien Bourmault 2019-07-10 01:23:48 +02:00
parent df654066a8
commit 84a74f804d
2 changed files with 10 additions and 2 deletions

View File

@ -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||

View File

@ -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)