diff --git a/windows/installer/autounattend/autounattend.xml b/windows/installer/autounattend/autounattend.xml
index 29d6461..a68c48d 100644
--- a/windows/installer/autounattend/autounattend.xml
+++ b/windows/installer/autounattend/autounattend.xml
@@ -113,21 +113,17 @@
bootstrap-OneTime!true
1
- cmd /c schtasks /Create /TN "SilverOSWelcome" /TR ""C:\Program Files\SilverOS\Welcome\SilverOS.Welcome.App.exe"" /SC ONCE /ST 23:59 /RL HIGHEST /IT /F
- Register SilverOS Welcome as an elevated interactive scheduled task
-
-
- 2
- cmd /c schtasks /Run /TN "SilverOSWelcome"
- Run the SilverOS Welcome wizard elevated in the active session
+ cmd /c powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath 'C:\Program Files\SilverOS\Welcome\SilverOS.Welcome.App.exe' -Verb RunAs"
+ Launch SilverOS Welcome elevated
SilverMetal
diff --git a/windows/installer/build.ps1 b/windows/installer/build.ps1
index 925c3b2..36ee376 100644
--- a/windows/installer/build.ps1
+++ b/windows/installer/build.ps1
@@ -212,6 +212,26 @@ function Invoke-ServiceWim {
# Stage Welcome app + flavours while the WIM is still mounted.
Copy-WelcomePayload
+
+ # Bake offline UAC auto-approve policy so the Welcome wizard (launched via
+ # Start-Process -Verb RunAs in FirstLogonCommands) silently elevates during
+ # the ephemeral sm-bootstrap session without a UAC prompt.
+ # UAC stays enabled (EnableLUA=1); the wizard's hardening re-tightens the
+ # policy for the daily user. Only applies when Welcome is enabled.
+ if ($env:SILVERMETAL_WELCOME_ENABLED -ne '0') {
+ Write-Stage 'Stage 3d: bake offline UAC auto-approve policy (silent elevation for sm-bootstrap)'
+ $hive = Join-Path $mount 'Windows\System32\config\SOFTWARE'
+ & reg load HKLM\SM_OFFLINE "$hive" | Out-Null
+ if ($LASTEXITCODE -ne 0) { throw 'reg load SOFTWARE hive failed' }
+ try {
+ & reg add 'HKLM\SM_OFFLINE\Microsoft\Windows\CurrentVersion\Policies\System' /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f | Out-Null
+ & reg add 'HKLM\SM_OFFLINE\Microsoft\Windows\CurrentVersion\Policies\System' /v PromptOnSecureDesktop /t REG_DWORD /d 0 /f | Out-Null
+ Write-Host ' ConsentPromptBehaviorAdmin=0, PromptOnSecureDesktop=0 written to offline SOFTWARE hive.'
+ } finally {
+ [gc]::Collect(); Start-Sleep -Milliseconds 500
+ & reg unload HKLM\SM_OFFLINE | Out-Null
+ }
+ }
} finally {
Dismount-WindowsImage -Path $mount -Save | Out-Null
}