Skip to content

Commit

Permalink
Cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyCheeseMan authored Nov 7, 2024
1 parent 3821c92 commit 573b50f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions APP/Source Code/Uninstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,7 @@
from pathlib import Path
import winreg
import webbrowser
import ctypes
import tkinter.messagebox as messagebox
import sys

def is_admin():
try:
return ctypes.windll.shell32.IsUserAnAdmin()
except:
return False

def run_as_admin():
if not is_admin():
try:
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
sys.exit()
except Exception as e:
print(f"Error running as admin: {e}")
messagebox.showerror("Error", "Failed to elevate to admin.")
sys.exit()

customtkinter.set_appearance_mode("system")
customtkinter.set_default_color_theme("dark-blue")
Expand Down Expand Up @@ -95,6 +77,4 @@ def unistall():
button2 = customtkinter.CTkButton(master=frame, text="Github", width=100, height=35, font=("Roboto", 20), command=csplus)
button2.pack(pady=10, padx=10)

run_as_admin()

root.mainloop()

0 comments on commit 573b50f

Please sign in to comment.