From fa0339e587ecb0fe54b1915667e99b0e1d46babb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Sat, 23 Sep 2023 18:31:26 +0200 Subject: [PATCH] the upgrade assistant was removed (it was only needed when updating to version 2.0.3) --- wingetui/__init__.py | 6 ---- wingetui/upgradeAssistant.py | 63 ------------------------------------ 2 files changed, 69 deletions(-) delete mode 100644 wingetui/upgradeAssistant.py diff --git a/wingetui/__init__.py b/wingetui/__init__.py index 17da986a0..22e8274ac 100644 --- a/wingetui/__init__.py +++ b/wingetui/__init__.py @@ -12,7 +12,6 @@ import os import sys -from upgradeAssistant import doTheMagic if "--debugcrash" in sys.argv: @@ -31,11 +30,6 @@ ctypes.windll.user32.MessageBoxW(None, "WingetUI can't be installed in a path containing special characters. Please reinstall WingetUI on a valid location\n\n\nCurrent path: " + os.path.dirname(sys.executable) + "\nInvalid character detected: " + specialCharacter + "\n\n\nPlease run the WingetUI installer and select a different install location. A possible valid path could be C:\\Program Files\\WingetUI", "WingetUI Crash handler", 0x00000010) sys.exit(1) -# Remove old WingetUI installation -if "AppData" not in sys.executable: - from threading import Thread - Thread(target=doTheMagic, daemon=True).start() - def CheckProgramIntegrity(): # BEGIN AUTOGENERATED HASH DICTIONARY diff --git a/wingetui/upgradeAssistant.py b/wingetui/upgradeAssistant.py deleted file mode 100644 index 289d313db..000000000 --- a/wingetui/upgradeAssistant.py +++ /dev/null @@ -1,63 +0,0 @@ -""" - -wingetui/upgradeAssistant.py - -This file contains the code that will migrate WingetUI to C:\\Program Files when installing version 2.0.3 - -""" - - -import os -import winreg -import glob - - -def doTheMagic(): - try: - REG_PATH = r"Software\Microsoft\Windows\CurrentVersion\Uninstall\{889610CC-4337-4BDB-AC3B-4F21806C0BDD}_is1" - - INSTALL_LOCATION = os.path.join(os.path.expanduser("~"), "AppData/Local/Programs/WingetUI") - try: - key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, REG_PATH, 0, winreg.KEY_ALL_ACCESS) - for i in range(1024): - try: - val = winreg.EnumValue(key, i) - if val[0] == "InstallLocation": - print("Found install path on ", val[1]) - INSTALL_LOCATION = val[1] - winreg.DeleteValue(key, val[0]) - print(val) - except OSError: - break - winreg.DeleteKey(winreg.HKEY_CURRENT_USER, REG_PATH) - except FileNotFoundError: - print("No old installation found") - return - except Exception as e: - print("Can't delete registry keys, ", e) - - try: - os.remove(os.path.join(os.path.expanduser("~"), "AppData/Roaming/Microsoft/Windows/Start Menu/Programs/WingetUI.lnk")) - except Exception as e: - print("Can't delete start menu entry, ", e) - - try: - os.remove(os.path.join(os.path.expanduser("~"), "AppData/Roaming/Microsoft/Windows/Start Menu/WingetUI.lnk")) - except Exception as e: - print("Can't delete start menu entry, ", e) - - try: - os.remove(os.path.join(os.path.expanduser("~"), "Desktop/WingetUI.lnk")) - except Exception as e: - print("Can't delete desktop entry, ", e) - - for file in glob.glob(INSTALL_LOCATION + "/**/*.*", recursive=True): - if "choco-cli" in file: - print(f"Not deleting {file} because is chocolatey component!") - else: - try: - os.remove(file) - except Exception as e: - print(f"Can't delete file {file}, ", e) - except Exception as e: - print(e)