Add potential fix for windows admin lockout

This commit is contained in:
Andrew 2021-11-29 16:56:17 -05:00
parent a6b380152a
commit 79284a9094

View File

@ -16,6 +16,7 @@ import pathlib
import shutil import shutil
from requests import get from requests import get
from contextlib import suppress from contextlib import suppress
import ctypes
from datetime import datetime from datetime import datetime
from socket import gethostname from socket import gethostname
@ -339,10 +340,16 @@ class Helpers:
return False return False
def checkRoot(self): def checkRoot(self):
if os.geteuid() == 0: if helper.is_os_windows():
return True if ctypes.windll.shell32.IsUserAnAdmin() == 0:
return True
else:
return False
else: else:
return False if os.geteuid() == 0:
return True
else:
return False
def unzipFile(self, zip_path): def unzipFile(self, zip_path):
new_dir_list = zip_path.split('/') new_dir_list = zip_path.split('/')