-
-
Notifications
You must be signed in to change notification settings - Fork 137
/
uninstall.py
executable file
·48 lines (33 loc) · 1.14 KB
/
uninstall.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/python
import os
import sys
import shutil
if os.path.exists('/data/data/com.termux/files'):
pass
else:
if os. geteuid() != 0:
exit("You need to have root privileges to run this script.")
sys.exit()
inp=input('Are You Sure To Uninstall DARKARMY ? (yes/no) = ')
if inp.lower()=='yes' or inp.lower()=='y':
if os.path.exists('/data/data/com.termux/files'):
INSTALL_DIR="$PREFIX/usr/share/doc/DARKARMY"
BIN_DIR="$PREFIX/usr/bin/"
else:
INSTALL_DIR="/usr/share/doc/DARKARMY"
BIN_DIR="/usr/bin/"
print('Deleteing `'+BIN_DIR+'DARKARMY` File')
try:
os.remove(BIN_DIR+'DARKARMY')
except:
print('Application Couldn\'t uninstall , make sure you have proper permission or reinstall it again to uninstall')
sys.exit()
print('Deleteing `'+INSTALL_DIR+'` Folder')
try:
shutil.rmtree(INSTALL_DIR)
except:
print('Application Couldn\'t uninstall , make sure you have proper permission or reinstall it again to uninstall')
sys.exit()
print('Uninstall Success!')
else:
print('Uninstall Canceled! ')