|
|
|
@ -649,10 +649,10 @@ def OrchestratorRerunAsAdmin():
|
|
|
|
|
if not OrchestratorIsAdmin():
|
|
|
|
|
if "PYTHON_CONFIGURE" in os.environ:
|
|
|
|
|
# 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)
|
|
|
|
|
ctypes.windll.shell32.ShellExecuteW(None, "runas", "cmd", " ".join(["/C", "cd /d", 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)
|
|
|
|
|
ctypes.windll.shell32.ShellExecuteW(None, "runas", "cmd", " ".join(["/C", "cd /d", f'"{os.getcwd()}"', "&&", sys.executable,sys.argv]), None, 1)
|
|
|
|
|
else:
|
|
|
|
|
print(f"Уже запущено с правами администратора!")
|
|
|
|
|
|
|
|
|
|