-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuninstaller.py
23 lines (20 loc) · 928 Bytes
/
uninstaller.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
# todo: python 3.7 and 3.8 doesn't have this module, please update!
import winreg
print("""
=====================================================================
====== POWFU - FILE ORGANIZER ======
====== Uninstaller ======
=====================================================================
""")
def delete_key(key, value):
reg_connector = winreg.ConnectRegistry(None, winreg.HKEY_CLASSES_ROOT)
reg_key = winreg.OpenKeyEx(reg_connector, 'Directory/Background/shell', 0, winreg.KEY_READ)
with reg_key:
try:
if value is None:
winreg.DeleteKey(reg_key, key)
winreg.CloseKey(reg_key)
os.unlink(os.path.join("C:", "Program Files", "PowFu - File Organizer"))
except WindowsError as we:
print(f"Something went wrong!\n{we}")