|
|
@ -647,8 +647,12 @@ def OrchestratorRerunAsAdmin():
|
|
|
|
:return: True - Запущен с правами администратора; False - Не запущен с правами администратора
|
|
|
|
:return: True - Запущен с правами администратора; False - Не запущен с правами администратора
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if not OrchestratorIsAdmin():
|
|
|
|
if not OrchestratorIsAdmin():
|
|
|
|
# Re-run the program with admin rights
|
|
|
|
if "PYTHON_CONFIGURE" in os.environ:
|
|
|
|
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
|
|
|
|
# Re-run the program with admin rights
|
|
|
|
|
|
|
|
ctypes.windll.shell32.ShellExecuteW(None, "runas", "cmd", " ".join(["/C", "cd", f'"{os.getcwd()}"', "&&",f'"{os.environ["PYTHON_CONFIGURE"]}"',sys.executable]+sys.argv), None, 1)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
# Re-run the program with admin rights
|
|
|
|
|
|
|
|
ctypes.windll.shell32.ShellExecuteW(None, "runas", "cmd", " ".join(["/C", "cd", f'"{os.getcwd()}"', "&&", sys.executable,sys.argv]), None, 1)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print(f"Уже запущено с правами администратора!")
|
|
|
|
print(f"Уже запущено с правами администратора!")
|
|
|
|
|
|
|
|
|
|
|
|