feat: WinPE pre-config collector + simplified first-boot toolbox (SP1) #21
@@ -235,7 +235,11 @@ try {
|
|||||||
|
|
||||||
Set-Content -Path 'X:\sm\unattend.generated.xml' -Value $xml -Encoding UTF8
|
Set-Content -Path 'X:\sm\unattend.generated.xml' -Value $xml -Encoding UTF8
|
||||||
|
|
||||||
Start-Process -FilePath 'X:\sources\setup.exe' -ArgumentList '/unattend:X:\sm\unattend.generated.xml' -Wait
|
try { [void][xml](Get-Content 'X:\sm\unattend.generated.xml' -Raw) }
|
||||||
|
catch { [Environment]::Exit(1) } # bad XML -> fall back to default answer file
|
||||||
|
|
||||||
|
$setup = if (Test-Path 'X:\sources\setup.exe') { 'X:\sources\setup.exe' } else { 'X:\setup.exe' }
|
||||||
|
Start-Process -FilePath $setup -ArgumentList '/unattend:X:\sm\unattend.generated.xml' -Wait
|
||||||
[Environment]::Exit(0)
|
[Environment]::Exit(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
set "SETUP=X:\sources\setup.exe"
|
||||||
|
if not exist "%SETUP%" set "SETUP=X:\setup.exe"
|
||||||
REM WinPE entry point. SM_UNATTENDED=1 -> skip the UI and launch Setup with the default
|
REM WinPE entry point. SM_UNATTENDED=1 -> skip the UI and launch Setup with the default
|
||||||
REM answer file (used by CI / non-interactive builds).
|
REM answer file (used by CI / non-interactive builds).
|
||||||
if "%SM_UNATTENDED%"=="1" (
|
if "%SM_UNATTENDED%"=="1" (
|
||||||
start /wait X:\sources\setup.exe /unattend:X:\autounattend.xml
|
start /wait "%SETUP%" /unattend:X:\autounattend.xml
|
||||||
exit /b 0
|
exit /b 0
|
||||||
)
|
)
|
||||||
powershell -NoProfile -ExecutionPolicy Bypass -File X:\sm\Collector.ps1
|
powershell -NoProfile -ExecutionPolicy Bypass -File X:\sm\Collector.ps1
|
||||||
if errorlevel 1 (
|
if errorlevel 1 (
|
||||||
REM Collector failed or was cancelled -> fall back to the default answer file so install still proceeds.
|
REM Collector failed or was cancelled -> fall back to the default answer file so install still proceeds.
|
||||||
start /wait X:\sources\setup.exe /unattend:X:\autounattend.xml
|
start /wait "%SETUP%" /unattend:X:\autounattend.xml
|
||||||
)
|
)
|
||||||
exit /b 0
|
exit /b 0
|
||||||
|
|||||||
Reference in New Issue
Block a user