diff --git a/src/downloader.py b/src/downloader.py index 85dcd54..e25040b 100644 --- a/src/downloader.py +++ b/src/downloader.py @@ -146,6 +146,10 @@ class newcredentials: self.password = invite.key AESObj = AESCipher(globs.CNIRCryptoKey) + try: + os.mkdir(globs.CNIRFolder + '\\config') + except: + pass with open(globs.CNIRConfig, 'wb+') as (configFile): logfile.printdbg('Saving credentials in encrypted config file') configFile.write(AESObj.encrypt(self.login + '||' + self.password)) diff --git a/src/globs.py b/src/globs.py index 0bdd936..0cf1aac 100644 --- a/src/globs.py +++ b/src/globs.py @@ -25,21 +25,21 @@ import os # CNIRevelator version -version = [3, 0, 0] -verstring_full = "{}.{}.{}".format(version[0], version[1], version[2]) -verstring = "{}.{}".format(version[0], version[1]) +version = [3, 0, 0] +verstring_full = "{}.{}.{}".format(version[0], version[1], version[2]) +verstring = "{}.{}".format(version[0], version[1]) -changelog = "Mise-à-jour majeure avec corrections suivantes :\n- Renouvellement de la signature numérique de l'exécutable\n- Amélioration de présentation du log en cas d'erreur\n- Refonte totale du code source et désobfuscation\n- Téléchargements en HTTPS fiables avec somme de contrôle" +changelog = "Mise-à-jour majeure avec corrections suivantes :\n- Renouvellement de la signature numérique de l'exécutable\n- Amélioration de présentation du log en cas d'erreur\n- Refonte totale du code source et désobfuscation\n- Téléchargements en HTTPS fiables avec somme de contrôle" -CNIRTesserHash = '5b58db27f7bc08c58a2cb33d01533b034b067cf8' -CNIRFolder = os.getcwd() -CNIRLColor = "#006699" -CNIRName = "CNIRevelator {}".format(verstring) -CNIRCryptoKey = '82Xh!efX3#@P~2eG' +CNIRTesserHash = '5b58db27f7bc08c58a2cb33d01533b034b067cf8' +CNIRFolder = os.getcwd() +CNIRLColor = "#006699" +CNIRName = "CNIRevelator {}".format(verstring) +CNIRCryptoKey = '82Xh!efX3#@P~2eG' -CNIRConfig = CNIRFolder + '\\config\\conf.ig' -CNIRErrLog = CNIRFolder + '\\logs\\\\error.log' -CNIRLauncherLog = CNIRFolder + '\\logs\\\\launcher.log' -CNIRUrlConfig = CNIRFolder + '\\config\\urlconf.ig' -CNIRVerStock = CNIRFolder + '\\downloads\\versions.lst' -CNIREnv = os.getenv('APPDATA') + '/CNIRevelator/' +CNIRConfig = CNIRFolder + '\\config\\conf.ig' +CNIRErrLog = CNIRFolder + '\\logs\\error.log' +CNIRLauncherLog = CNIRFolder + '\\logs\\launcher.log' +CNIRUrlConfig = CNIRFolder + '\\config\\urlconf.ig' +CNIRVerStock = CNIRFolder + '\\downloads\\versions.lst' +CNIREnv = os.getenv('APPDATA') + '/CNIRevelator/' diff --git a/src/id-card.ico b/src/id-card.ico new file mode 100644 index 0000000..efa86e4 Binary files /dev/null and b/src/id-card.ico differ diff --git a/src/logger.py b/src/logger.py index cb64567..5acd8f8 100644 --- a/src/logger.py +++ b/src/logger.py @@ -35,6 +35,7 @@ class NewLoggingSystem: # Deleting the error log try: + os.mkdir(globs.CNIRFolder + '\\logs') os.remove(globs.CNIRErrLog) except Exception as e: pass diff --git a/src/updater.py b/src/updater.py index 57c48d3..2b91429 100644 --- a/src/updater.py +++ b/src/updater.py @@ -27,6 +27,7 @@ from win32com.client import Dispatch import traceback import sys import time +import os import logger # logger.py import globs # globs.py @@ -82,11 +83,19 @@ def batch(): except FileNotFoundError: logfile.printdbg('Recreate urlconf.ig') # Recreating the url file + try: + os.mkdir(globs.CNIRFolder + '\\config') + except: + pass with open(globs.CNIRUrlConfig, 'w') as (configFile): configFile.write("https://raw.githubusercontent.com/neox95/CNIRevelator/master/VERSIONS.LST\n0\n0") #XXX # Getting the list of versions of the software logfile.printdbg('Retrieving the software versions') + try: + os.mkdir(globs.CNIRFolder + '\\downloads') + except: + pass getTheVersions = downloader.newdownload(credentials, urlparsed[0], globs.CNIRFolder + '\\versions.lst').download() logfile.printdbg('Parsing the software versions')