diff --git a/API/Tiri.zip b/API/Tiri.zip new file mode 100644 index 0000000..ec45b4e Binary files /dev/null and b/API/Tiri.zip differ diff --git a/CLI/Config.ini b/CLI/Config.ini index 9f61f79..1094eaf 100644 --- a/CLI/Config.ini +++ b/CLI/Config.ini @@ -1,5 +1,5 @@ [DEFAULT] -version = 1.01 +version = 1.21 [ACCOUNT] key = NK diff --git a/CLI/Init.py b/CLI/Init.py index c088ef2..130194e 100644 --- a/CLI/Init.py +++ b/CLI/Init.py @@ -1,7 +1,7 @@ #it Wasnt the venv .... πŸ˜πŸ”« --> 🏠πŸ”₯ --> πŸ‘ΆπŸ»πŸ‘·πŸ»πŸ’€ -APP_VERSION = 1.01 - +APP_VERSION = 1.21 +import zipfile import configparser import os from pathlib import Path @@ -11,6 +11,10 @@ import sys import tkinter as tk from tkinter import filedialog + + + + parser = argparse.ArgumentParser(description='TiropitLauncher CLI & Back-End') parser.add_argument('-backend', help="Runs the app in backend mode (no UI)", action="store_true") @@ -112,8 +116,6 @@ def select_folder(): - - def TiropitLogin(): class menuData(): def menuInstructions(): @@ -170,7 +172,6 @@ def loadConfig(): - # [Update Functions] <------------------------------------------------------------------------------------------------------------ [Begin] def CheckForUpdate(log=False): @@ -179,7 +180,7 @@ def CheckForUpdate(log=False): response = requests.get(TiropitCLI.url + "/api/getTiropitVersion") if log:print(f"ResponseCode:{response.status_code}") data = response.json() - + if log:print(f"ResponseJSON:{data}") version = float(data["Version"]) @@ -188,12 +189,26 @@ def CheckForUpdate(log=False): if float(version) > float(currentVersion): if log:print(f"Downloading & Installing Update {version}") - download_file("https://kevinblog.sytes.net/APIS/TiropitLauncher/TiropitAPI.php", "test.mogus") + download_file("https://kevinblog.sytes.net/APIS/TiropitLauncher/Tiri.zip", "update.zip") + unzipFile("update.zip", ".") + print("Assuming Update Done - Exiting , Restart Tiropit") else: if log:print(f"Already using latest version -> {currentVersion}") + +def unzipFile(filename,path): + os.makedirs(path, exist_ok=True) + + with zipfile.ZipFile(filename, "r") as zf: + zf.extractall(path) + print(f"Extract Done :) to {path}") + + + + + def download_file(url, filename): with requests.get(url, stream=True) as r: diff --git a/CLI/test.mogus b/CLI/test.mogus deleted file mode 100644 index 0dfe776..0000000 --- a/CLI/test.mogus +++ /dev/null @@ -1 +0,0 @@ -{"status":"error","message":"No SteamID provided","version":"1.0.5"} \ No newline at end of file