pixel-tool
Simple Windows tool for debloating and improving performance.
git clone https://git.pi66.xyz/pixel-tool
About | Files | Commits | Refs | License
Add files via upload
Author: Pixel2175
Date: 2024-08-21 11:35
commit: c4dee5d4
Stat
| A | ui.py | 16 | +16 | -0 |
Diff
diff --git a/ui.py b/ui.py
index c396c6e..c54fcb1 100644
--- a/ui.py
+++ b/ui.py
@@ -5,10 +5,24 @@ import webbrowser as web
import data
import os
import requests as req
+import ctypes
+import sys
+
+def is_admin():
+ try:
+ return ctypes.windll.shell32.IsUserAnAdmin()
+ except:
+ return False
+
+if not is_admin():
+ ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
+ sys.exit()
...
Show all
Show less
diff --git a/ui.py b/ui.py
index c396c6e..c54fcb1 100644
--- a/ui.py
+++ b/ui.py
@@ -5,10 +5,24 @@ import webbrowser as web
import data
import os
import requests as req
+import ctypes
+import sys
+
+def is_admin():
+ try:
+ return ctypes.windll.shell32.IsUserAnAdmin()
+ except:
+ return False
+
+if not is_admin():
+ ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
+ sys.exit()
...
diff --git a/ui.py b/ui.py
index c396c6e..c54fcb1 100644
--- a/ui.py
+++ b/ui.py
@@ -5,10 +5,24 @@ import webbrowser as web
import data
import os
import requests as req
+import ctypes
+import sys
+
+def is_admin():
+ try:
+ return ctypes.windll.shell32.IsUserAnAdmin()
+ except:
+ return False
+
+if not is_admin():
+ ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
+ sys.exit()
+
tk.set_appearance_mode('dark')
tk.set_default_color_theme('theme/purpel.json')
+
if os.path.exists('log.py'):
import log
else:
@@ -16,6 +30,8 @@ else:
f.write("tweaks=[]")
import log
+
+
class Update(tk.CTkToplevel):
def __init__(self,main):
super().__init__(main)