fix start when disk D (another of dick C)

dev-fastapi
Иван Маслов 2 years ago
parent 585ac0d35c
commit 7d5eeb6f88

@ -42,7 +42,7 @@ cd /d %TEMP_LOCATION%
set PYTHONPATH=%cd%;%PYTHONPATH%
rem восстановление каталога рабочей директории программы
cd %CD_PREV%
cd /d %CD_PREV%
rem выполнить вызов, если есть параметры, начиная с %2+
if "%1"=="" goto :echo_check

@ -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"Уже запущено с правами администратора!")

Loading…
Cancel
Save