* Script to install deps (Windows only for now) * Set runner temp dir for choco * Add missing os import * Modify for CI * Update CL * Improve logging * Update workflow to install deps via script * Explain 3.1.1 version lock
16 lines
471 B
Python
16 lines
471 B
Python
import ctypes
|
|
import sys
|
|
|
|
def relaunch_as_admin(script):
|
|
args = ' '.join(sys.argv[1:])
|
|
command = f'{script} --pause-on-exit {args}'
|
|
print(f'Re-launching script as admin: {command}')
|
|
ctypes.windll.shell32.ShellExecuteW(None, 'runas', sys.executable, command, None, 1)
|
|
|
|
def is_admin():
|
|
"""Returns True if the current process has admin privileges."""
|
|
try:
|
|
return ctypes.windll.shell32.IsUserAnAdmin()
|
|
except ctypes.WinError:
|
|
return False
|