fix: support spaces in elevated DEP script paths

This commit is contained in:
Dusk-92
2026-08-28 18:08:35 +02:00
parent 4bc60a3a6a
commit e01cdd967e
2 changed files with 57 additions and 4 deletions
+4 -4
View File
@@ -1792,12 +1792,12 @@ class WowSetupTool:
escaped_script = script_path.replace("'", "''")
launcher = (
"$ErrorActionPreference='Stop'; "
f"$scriptPath = '{escaped_script}'; "
"$argumentLine = '-NoProfile -NonInteractive -ExecutionPolicy Bypass -File \"' "
"+ $scriptPath + '\"'; "
"try { "
"$p = Start-Process -FilePath 'powershell.exe' -Verb RunAs "
"-Wait -PassThru -ArgumentList @("
"'-NoProfile','-NonInteractive','-ExecutionPolicy','Bypass',"
f"'-File','{escaped_script}'"
"); "
"-Wait -PassThru -ArgumentList $argumentLine; "
"exit $p.ExitCode "
"} catch { Write-Error $_; exit 1 }"
)