fix(deploy-win): wallpaper reg add hung post-install (PS 5.1 empty-arg)

PowerShell 5.1 strips an empty-string argument ('') when invoking a native
exe, so `reg add ... /d '' /f` reached reg.exe as `reg add ... /d /f`: reg
consumed /f as the data value, lost the force flag, and prompted
"overwrite? (Yes/No)" on stdin. FirstLogon runs headless with no stdin, so
post-install hung forever right after the "Explorer UX tweaks applied" log
line. Route both empty-value reg adds (HKCU + Default hive) through
`cmd /c`, which preserves the empty "" so the value is set and /f stays.

Regression from 8095f00 (wallpaper removal feature).
This commit is contained in:
2026-06-09 23:59:41 +02:00
parent 7dea74e2ec
commit 04dab4b037
@@ -264,7 +264,11 @@ reg add 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' /v La
L 'Explorer UX tweaks applied (HKCU)'
# ── No desktop wallpaper (keep the WS2025 default background colour) ──────
reg add 'HKCU\Control Panel\Desktop' /v Wallpaper /t REG_SZ /d '' /f | Out-Null
# NOTE: route the empty-value reg add through cmd /c. PowerShell 5.1 STRIPS an
# empty-string argument ('') when calling a native exe, so `reg add ... /d '' /f`
# would arrive as `reg add ... /d /f` — reg then eats /f as the data, loses the
# force flag, and PROMPTS "overwrite? (Yes/No)" on stdin → the script hangs.
cmd /c 'reg add "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "" /f' | Out-Null
reg add 'HKCU\Control Panel\Desktop' /v WallpaperStyle /t REG_SZ /d 0 /f | Out-Null
L 'Wallpaper removed (default background colour, HKCU)'
@@ -284,7 +288,8 @@ reg add 'HKU\DefaultUser2\Software\Microsoft\Windows\CurrentVersion\Explorer\Adv
reg add 'HKU\DefaultUser2\Console\%Startup' /v DelegationConsole /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
reg add 'HKU\DefaultUser2\Console\%Startup' /v DelegationTerminal /t REG_SZ /d '{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}' /f | Out-Null
# No wallpaper (keep default background colour) for any future profile.
reg add 'HKU\DefaultUser2\Control Panel\Desktop' /v Wallpaper /t REG_SZ /d '' /f | Out-Null
# cmd /c for the empty value — see PS-5.1 empty-arg note in the HKCU block above.
cmd /c 'reg add "HKU\DefaultUser2\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "" /f' | Out-Null
reg add 'HKU\DefaultUser2\Control Panel\Desktop' /v WallpaperStyle /t REG_SZ /d 0 /f | Out-Null
reg unload HKU\DefaultUser2 2>&1 | Out-Null
L 'Taskbar: search hidden, task view hidden, WT default terminal, no wallpaper'