From 7d95f104cb7de29a678dcbbe1fec69a3956b8492 Mon Sep 17 00:00:00 2001 From: Abhiraj Rik <133798548+abrik1@users.noreply.github.com> Date: Tue, 21 Nov 2023 21:54:30 +0530 Subject: [PATCH] x86 database works in x64 :) --- main.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index b376925..fdec2f9 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,7 @@ from colorama import init, Fore, Style from wmi import WMI from time import sleep +from platform import architecture xpykg_version = "0.1" init() # initialize colorama @@ -153,9 +154,15 @@ def install_package(package: str): if status_code == 0: print("{}{}[xpykg:sucess]:{} {}{}{} installed sucessfully".format(Style.BRIGHT, Fore.GREEN, Fore.RESET, Fore.YELLOW, package, Fore.RESET)) if "isUninstallerByNullsoft" in list(contents[package].keys()): # determine nullsoft uninstallers: - append_to_install(package, contents[package]['version'], contents[package]['remover'], "UninstallerByNullsoft") + if architecture()[0] == "64bit": + append_to_install(package, contents[package]['version'], contents[package]['remover'].replace("Program Files", "Program Files (x86)"), "UninstallerByNullsoft") + else: + append_to_install(package, contents[package]['version'], contents[package]['remover'], "UninstallerByNullsoft") else: # for normal uninstallers - append_to_install(package, contents[package]['version'], contents[package]['remover'], "Normal") + if architecture()[0] == "64bit": + append_to_install(package, contents[package]['version'], contents[package]['remover'].replace("Program Files", "Program Files (x86)"), "Normal") + else: + append_to_install(package, contents[package]['version'], contents[package]['remover'], "Normal") return 0 else: @@ -369,7 +376,7 @@ def upgrade_packages(): uninstall_package(argv[2]) else: for i in range(2, len(argv)): - print(argv[i]) + uninstall_package(argv[i]) elif argv[1] in ["-U", "upgrade", "--upgrade"]: upgrade_packages() else: