BIOS check fix, parallel downloads, shopfloor hardening
- Fix check-bios.cmd: replace parenthesized if blocks with goto labels (cmd.exe fails silently with if/else on network-mapped drives) - Move BIOS check files to winpeapps/_shared/BIOS for reliable SMB access - Add network wait loop before BIOS check in startnet.cmd - Show firmware status in WinPE menu header (BIOS_STATUS variable) - Add BypassNRO registry key to skip OOBE network requirement - Refactor download-drivers.py with --parallel N flag (ThreadPoolExecutor) - Set SupportUser AutoLogonCount to 3 in shopfloor unattend - Add shutdown -a at start + shutdown /r /t 10 at end of Run-ShopfloorSetup.ps1 - Switch download-drivers.py from wget to curl for reliable stall detection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
166
playbook/FlatUnattendW10-shopfloor.xml
Normal file
166
playbook/FlatUnattendW10-shopfloor.xml
Normal file
@@ -0,0 +1,166 @@
|
||||
<?xml version="1.0"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="windowsPE">
|
||||
</settings>
|
||||
<settings pass="offlineServicing">
|
||||
<component name="Microsoft-Windows-PnpCustomizationsNonWinPE" processorArchitecture="*arch*" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
|
||||
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<DriverPaths>
|
||||
<PathAndCredentials xmlns="" wcm:keyValue="1" action="add">
|
||||
<Path>W:\Drivers</Path>
|
||||
</PathAndCredentials>
|
||||
</DriverPaths>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="specialize">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="*arch*" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
|
||||
<ComputerName>H%serialnumber%</ComputerName>
|
||||
<RegisteredOrganization>GE Aerospace</RegisteredOrganization>
|
||||
<RegisteredOwner>GE</RegisteredOwner>
|
||||
<TimeZone>Eastern Standard Time</TimeZone>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Deployment" processorArchitecture="*arch*" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
|
||||
<RunSynchronous>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>1</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\GE_External_Root_CA_2_1.cer' -CertStoreLocation 'Cert:\LocalMachine\Root'"</Path>
|
||||
<Description>Install External Root Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>2</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\GE_External_Intermediate_CA_2_1.cer' -CertStoreLocation 'Cert:\LocalMachine\CA'"</Path>
|
||||
<Description>Install External Intermediate Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>3</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\GE_Enterprise_Root_CA_2_1.cer' -CertStoreLocation 'Cert:\LocalMachine\Root'"</Path>
|
||||
<Description>Install Enterprise Root Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>4</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\GE_Enterprise_Device_Issuing_CA_2_1.cer' -CertStoreLocation 'Cert:\LocalMachine\CA'"</Path>
|
||||
<Description>Install Enterprise Device Issuing Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>5</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\GE_Enterprise_Server_Issuing_CA_2_1.cer' -CertStoreLocation 'Cert:\LocalMachine\CA'"</Path>
|
||||
<Description>Install Enterprise Server Issuing Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>6</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\GE_Enterprise_Smart_Card_Issuing_CA_2_1.cer' -CertStoreLocation 'Cert:\LocalMachine\CA'"</Path>
|
||||
<Description>Install Enterprise SmartCard Issuing Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>7</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\GE_Enterprise_User_Issuing_CA_2_1.cer' -CertStoreLocation 'Cert:\LocalMachine\CA'"</Path>
|
||||
<Description>Install Enterprise User Issuing Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>8</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\GE_Aerospace_Enterprise_Root_CA_1.cer' -CertStoreLocation 'Cert:\LocalMachine\Root'"</Path>
|
||||
<Description>Install Aerospace Enterprise Root Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>9</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Import-Certificate -FilePath 'C:\Deploy\Applications\ZscalerCommercialCertificate-2048-SHA256.crt' -CertStoreLocation 'Cert:\LocalMachine\Root'"</Path>
|
||||
<Description>Install Zscaler Commercial Certificate</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Path>reg.exe add "HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff" /f </Path>
|
||||
<Description>Disable Network Windows</Description>
|
||||
<Order>10</Order>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>11</Order>
|
||||
<Path>netsh wlan add profile filename="C:\Deploy\Applications\extra\wireless\WiFi-Profile.xml" user=all</Path>
|
||||
<Description>Install INTERNETACCESS WiFi Profile</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>12</Order>
|
||||
<Path>powershell.exe -ExecutionPolicy Bypass -Command "Enable-PSRemoting -Force -SkipNetworkProfileCheck"</Path>
|
||||
<Description>Enable WinRM</Description>
|
||||
</RunSynchronousCommand>
|
||||
<RunSynchronousCommand wcm:action="add">
|
||||
<Order>13</Order>
|
||||
<Path>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v BypassNRO /t REG_DWORD /d 1 /f</Path>
|
||||
<Description>Bypass OOBE network requirement</Description>
|
||||
</RunSynchronousCommand>
|
||||
</RunSynchronous>
|
||||
</component>
|
||||
</settings>
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-International-Core" processorArchitecture="*arch*" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
|
||||
<InputLocale>en-US</InputLocale>
|
||||
<SystemLocale>en-US</SystemLocale>
|
||||
<UILanguage>en-US</UILanguage>
|
||||
<UserLocale>en-US</UserLocale>
|
||||
</component>
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="*arch*" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
|
||||
<OOBE>
|
||||
<HideEULAPage>true</HideEULAPage>
|
||||
<HideLocalAccountScreen>true</HideLocalAccountScreen>
|
||||
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
|
||||
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
|
||||
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
|
||||
<ProtectYourPC>3</ProtectYourPC>
|
||||
</OOBE>
|
||||
<UserAccounts>
|
||||
<LocalAccounts>
|
||||
<LocalAccount wcm:action="add">
|
||||
<Password>
|
||||
<Value>Pa55word</Value>
|
||||
<PlainText>true</PlainText>
|
||||
</Password>
|
||||
<Name>SupportUser</Name>
|
||||
<Group>Administrators</Group>
|
||||
<DisplayName>SupportUser</DisplayName>
|
||||
</LocalAccount>
|
||||
</LocalAccounts>
|
||||
</UserAccounts>
|
||||
<AutoLogon>
|
||||
<Password>
|
||||
<Value>Pa55word</Value>
|
||||
<PlainText>true</PlainText>
|
||||
</Password>
|
||||
<Enabled>true</Enabled>
|
||||
<Username>SupportUser</Username>
|
||||
<LogonCount>7</LogonCount>
|
||||
</AutoLogon>
|
||||
<FirstLogonCommands>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>1</Order>
|
||||
<CommandLine>cmd.exe /c powercfg /change monitor-timeout-ac 0 & powercfg /change monitor-timeout-dc 0 & powercfg /change standby-timeout-ac 0 & powercfg /change standby-timeout-dc 0</CommandLine>
|
||||
<Description>Disable display and sleep timeout during setup</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>2</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -Command "Get-NetAdapter -Physical | Where-Object { $_.InterfaceDescription -match 'Wi-Fi|Wireless' } | Set-NetIPInterface -InterfaceMetric 10; Get-NetAdapter -Physical | Where-Object { $_.InterfaceDescription -notmatch 'Wi-Fi|Wireless' } | Set-NetIPInterface -InterfaceMetric 100"</CommandLine>
|
||||
<Description>Prioritize WiFi over ethernet</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>3</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -Command "Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private"</CommandLine>
|
||||
<Description>Set network profile to Private</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>4</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -Command "Write-Host 'Waiting for internet connectivity...'; while (-not (Test-Connection -ComputerName login.microsoftonline.us -Count 1 -Quiet -ErrorAction SilentlyContinue)) { Start-Sleep -Seconds 5 }; Write-Host 'Internet connected.'"</CommandLine>
|
||||
<Description>Wait for internet connectivity</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>5</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File "C:\run-enrollment.ps1"</CommandLine>
|
||||
<Description>Run GCCH Enrollment</Description>
|
||||
</SynchronousCommand>
|
||||
<SynchronousCommand wcm:action="add">
|
||||
<Order>6</Order>
|
||||
<CommandLine>powershell.exe -ExecutionPolicy Bypass -File "C:\Enrollment\Run-ShopfloorSetup.ps1"</CommandLine>
|
||||
<Description>Run shopfloor PC type setup</Description>
|
||||
</SynchronousCommand>
|
||||
</FirstLogonCommands>
|
||||
<TimeZone>Eastern Standard Time</TimeZone>
|
||||
</component>
|
||||
</settings>
|
||||
</unattend>
|
||||
148
playbook/check-bios.cmd
Normal file
148
playbook/check-bios.cmd
Normal file
@@ -0,0 +1,148 @@
|
||||
@echo off
|
||||
REM check-bios.cmd - Check and apply Dell BIOS update from WinPE x64
|
||||
REM Sets BIOS_STATUS for startnet.cmd menu display
|
||||
|
||||
set "BIOSDIR=%~dp0"
|
||||
set "FLASH=%BIOSDIR%Flash64W.exe"
|
||||
set "MANIFEST=%BIOSDIR%models.txt"
|
||||
|
||||
if exist "%FLASH%" goto :flash_ok
|
||||
echo Flash64W.exe not found, skipping BIOS check.
|
||||
set "BIOS_STATUS=Skipped (Flash64W.exe missing)"
|
||||
exit /b 0
|
||||
|
||||
:flash_ok
|
||||
if exist "%MANIFEST%" goto :manifest_ok
|
||||
echo models.txt not found, skipping BIOS check.
|
||||
set "BIOS_STATUS=Skipped (models.txt missing)"
|
||||
exit /b 0
|
||||
|
||||
:manifest_ok
|
||||
REM --- Get system model from WMI ---
|
||||
set SYSMODEL=
|
||||
for /f "skip=1 tokens=*" %%M in ('wmic csproduct get name 2^>NUL') do (
|
||||
if not defined SYSMODEL set "SYSMODEL=%%M"
|
||||
)
|
||||
for /f "tokens=*" %%a in ("%SYSMODEL%") do set "SYSMODEL=%%a"
|
||||
|
||||
if "%SYSMODEL%"=="" goto :no_model
|
||||
goto :got_model
|
||||
|
||||
:no_model
|
||||
echo Could not detect system model, skipping BIOS check.
|
||||
set "BIOS_STATUS=Skipped (model not detected)"
|
||||
exit /b 0
|
||||
|
||||
:got_model
|
||||
echo Model: %SYSMODEL%
|
||||
|
||||
REM --- Get current BIOS version ---
|
||||
set BIOSVER=
|
||||
for /f "skip=1 tokens=*" %%V in ('wmic bios get smbiosbiosversion 2^>NUL') do (
|
||||
if not defined BIOSVER set "BIOSVER=%%V"
|
||||
)
|
||||
for /f "tokens=*" %%a in ("%BIOSVER%") do set "BIOSVER=%%a"
|
||||
echo Current BIOS: %BIOSVER%
|
||||
|
||||
REM --- Read manifest and find matching BIOS file ---
|
||||
set BIOSFILE=
|
||||
set TARGETVER=
|
||||
for /f "usebackq eol=# tokens=1,2,3 delims=|" %%A in ("%MANIFEST%") do (
|
||||
echo "%SYSMODEL%" | find /I "%%A" >NUL
|
||||
if not errorlevel 1 (
|
||||
set "BIOSFILE=%%B"
|
||||
set "TARGETVER=%%C"
|
||||
goto :found_bios
|
||||
)
|
||||
)
|
||||
|
||||
echo No BIOS update available for this model.
|
||||
set "BIOS_STATUS=%SYSMODEL% - no update in catalog"
|
||||
exit /b 0
|
||||
|
||||
:found_bios
|
||||
if not exist "%BIOSDIR%%BIOSFILE%" goto :bios_file_missing
|
||||
goto :bios_file_ok
|
||||
|
||||
:bios_file_missing
|
||||
echo WARNING: %BIOSFILE% not found in BIOS folder.
|
||||
set "BIOS_STATUS=%SYSMODEL% - %BIOSFILE% missing"
|
||||
exit /b 0
|
||||
|
||||
:bios_file_ok
|
||||
REM --- Skip if already at target version ---
|
||||
echo.%BIOSVER%| find /I "%TARGETVER%" >NUL
|
||||
if not errorlevel 1 goto :already_current
|
||||
|
||||
REM --- Compare versions to prevent downgrade ---
|
||||
call :compare_versions "%BIOSVER%" "%TARGETVER%"
|
||||
if "%VERCMP%"=="newer" goto :already_newer
|
||||
goto :do_flash
|
||||
|
||||
:already_current
|
||||
echo BIOS is already up to date - %TARGETVER%
|
||||
set "BIOS_STATUS=%SYSMODEL% v%BIOSVER% (up to date)"
|
||||
exit /b 0
|
||||
|
||||
:already_newer
|
||||
echo Current BIOS %BIOSVER% is newer than target %TARGETVER% - skipping.
|
||||
set "BIOS_STATUS=%SYSMODEL% v%BIOSVER% (up to date)"
|
||||
exit /b 0
|
||||
|
||||
:do_flash
|
||||
echo Update: %BIOSVER% -^> %TARGETVER%
|
||||
echo Applying BIOS update (this may take a few minutes, do not power off)...
|
||||
|
||||
pushd "%BIOSDIR%"
|
||||
Flash64W.exe /b="%BIOSFILE%" /s /f /l=X:\bios-update.log
|
||||
set FLASHRC=%ERRORLEVEL%
|
||||
popd
|
||||
echo Flash complete (exit code %FLASHRC%).
|
||||
|
||||
if "%FLASHRC%"=="3" goto :already_current
|
||||
if "%FLASHRC%"=="0" goto :flash_done
|
||||
if "%FLASHRC%"=="2" goto :staged
|
||||
if "%FLASHRC%"=="6" goto :staged
|
||||
|
||||
echo WARNING: Flash64W.exe returned unexpected code %FLASHRC%.
|
||||
set "BIOS_STATUS=%SYSMODEL% flash error (code %FLASHRC%)"
|
||||
exit /b 0
|
||||
|
||||
:flash_done
|
||||
echo BIOS update complete.
|
||||
set "BIOS_STATUS=%SYSMODEL% updated %BIOSVER% -^> %TARGETVER%"
|
||||
exit /b 0
|
||||
|
||||
:staged
|
||||
echo.
|
||||
echo ========================================
|
||||
echo BIOS update staged successfully.
|
||||
echo It will flash during POST after the
|
||||
echo post-imaging reboot.
|
||||
echo ========================================
|
||||
echo.
|
||||
set "BIOS_STATUS=%SYSMODEL% STAGED %BIOSVER% -^> %TARGETVER% (flashes on reboot)"
|
||||
exit /b 0
|
||||
|
||||
:compare_versions
|
||||
set "VERCMP=equal"
|
||||
set "_CV=%~1"
|
||||
set "_TV=%~2"
|
||||
for /f "tokens=1,2,3 delims=." %%a in ("%_CV%") do (
|
||||
set /a "C1=%%a" 2>NUL
|
||||
set /a "C2=%%b" 2>NUL
|
||||
set /a "C3=%%c" 2>NUL
|
||||
)
|
||||
for /f "tokens=1,2,3 delims=." %%a in ("%_TV%") do (
|
||||
set /a "T1=%%a" 2>NUL
|
||||
set /a "T2=%%b" 2>NUL
|
||||
set /a "T3=%%c" 2>NUL
|
||||
)
|
||||
if %C1% GTR %T1% ( set "VERCMP=newer" & goto :eof )
|
||||
if %C1% LSS %T1% ( set "VERCMP=older" & goto :eof )
|
||||
if %C2% GTR %T2% ( set "VERCMP=newer" & goto :eof )
|
||||
if %C2% LSS %T2% ( set "VERCMP=older" & goto :eof )
|
||||
if %C3% GTR %T3% ( set "VERCMP=newer" & goto :eof )
|
||||
if %C3% LSS %T3% ( set "VERCMP=older" & goto :eof )
|
||||
set "VERCMP=equal"
|
||||
goto :eof
|
||||
60
playbook/shopfloor-setup/Run-ShopfloorSetup.ps1
Normal file
60
playbook/shopfloor-setup/Run-ShopfloorSetup.ps1
Normal file
@@ -0,0 +1,60 @@
|
||||
# Run-ShopfloorSetup.ps1 — Dispatcher for shopfloor PC type setup
|
||||
# Runs Shopfloor baseline scripts first, then type-specific scripts on top.
|
||||
|
||||
# Cancel any pending reboot so it doesn't interrupt setup
|
||||
shutdown -a 2>$null
|
||||
|
||||
$enrollDir = "C:\Enrollment"
|
||||
$typeFile = Join-Path $enrollDir "pc-type.txt"
|
||||
$setupDir = Join-Path $enrollDir "shopfloor-setup"
|
||||
|
||||
if (-not (Test-Path $typeFile)) {
|
||||
Write-Host "No pc-type.txt found - skipping shopfloor setup."
|
||||
exit 0
|
||||
}
|
||||
|
||||
$pcType = (Get-Content $typeFile -First 1).Trim()
|
||||
if (-not $pcType) {
|
||||
Write-Host "pc-type.txt is empty - skipping shopfloor setup."
|
||||
exit 0
|
||||
}
|
||||
|
||||
Write-Host "Shopfloor PC Type: $pcType"
|
||||
|
||||
# --- Run Shopfloor baseline scripts first ---
|
||||
$baselineDir = Join-Path $setupDir "Shopfloor"
|
||||
if (Test-Path $baselineDir) {
|
||||
$scripts = Get-ChildItem -Path $baselineDir -Filter "*.ps1" -File | Sort-Object Name
|
||||
foreach ($script in $scripts) {
|
||||
shutdown /a 2>$null
|
||||
Write-Host "Running baseline: $($script.Name)"
|
||||
try {
|
||||
& $script.FullName
|
||||
} catch {
|
||||
Write-Warning "Baseline script $($script.Name) failed: $_"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# --- Run type-specific scripts (if not just baseline Shopfloor) ---
|
||||
if ($pcType -ne "Shopfloor") {
|
||||
$typeDir = Join-Path $setupDir $pcType
|
||||
if (Test-Path $typeDir) {
|
||||
$scripts = Get-ChildItem -Path $typeDir -Filter "*.ps1" -File | Sort-Object Name
|
||||
foreach ($script in $scripts) {
|
||||
shutdown /a 2>$null
|
||||
Write-Host "Running $pcType setup: $($script.Name)"
|
||||
try {
|
||||
& $script.FullName
|
||||
} catch {
|
||||
Write-Warning "Script $($script.Name) failed: $_"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Host "No type-specific scripts found for $pcType."
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Shopfloor setup complete for $pcType."
|
||||
Write-Host "Rebooting in 10 seconds..."
|
||||
shutdown /r /t 10
|
||||
@@ -3,37 +3,141 @@ echo Please wait while 'WinPE' is being processed. This may take a few seconds.
|
||||
wpeinit
|
||||
powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
|
||||
|
||||
REM --- Wait for network (DHCP may take a moment after wpeinit) ---
|
||||
echo Waiting for network...
|
||||
:wait_net
|
||||
ping -n 2 10.9.100.1 >NUL 2>&1
|
||||
if errorlevel 1 goto wait_net
|
||||
echo Network ready.
|
||||
|
||||
REM --- BIOS update check (runs before imaging menu) ---
|
||||
set BIOS_STATUS=No BIOS check (share unavailable)
|
||||
net use B: \\10.9.100.1\winpeapps\_shared /user:pxe-upload pxe /persistent:no 2>NUL
|
||||
if exist B:\BIOS\check-bios.cmd (
|
||||
echo.
|
||||
echo Checking for BIOS updates...
|
||||
call B:\BIOS\check-bios.cmd
|
||||
REM If BIOS was flashed, check-bios.cmd reboots and we never reach here.
|
||||
echo.
|
||||
)
|
||||
net use B: /delete 2>NUL
|
||||
|
||||
:menu
|
||||
cls
|
||||
echo.
|
||||
echo ========================================
|
||||
echo WinPE Setup Menu
|
||||
echo ========================================
|
||||
echo Firmware: %BIOS_STATUS%
|
||||
echo.
|
||||
echo Please select an option:
|
||||
echo.
|
||||
echo 1. GEA Standard
|
||||
echo 2. GEA Engineer
|
||||
echo 3. GEA Shopfloor
|
||||
echo 4. GEA Shopfloor MCE
|
||||
echo 5. GE Standard
|
||||
echo 6. GE Engineer
|
||||
echo 7. GE Shopfloor Lockdown
|
||||
echo 8. GE Shopfloor MCE
|
||||
echo 4. GE Standard
|
||||
echo 5. GE Engineer
|
||||
echo 6. GE Shopfloor Lockdown
|
||||
echo 7. GE Shopfloor MCE
|
||||
echo.
|
||||
echo ========================================
|
||||
echo.
|
||||
set /p choice=Enter your choice (1-8):
|
||||
set /p choice=Enter your choice (1-7):
|
||||
|
||||
REM --- Only shopfloor images (3,6,7) need GCCH enrollment ---
|
||||
set PPKG=
|
||||
if "%choice%"=="3" goto enroll_menu
|
||||
if "%choice%"=="6" goto enroll_menu
|
||||
if "%choice%"=="7" goto enroll_menu
|
||||
goto enroll_staged
|
||||
|
||||
:enroll_menu
|
||||
cls
|
||||
echo.
|
||||
echo ========================================
|
||||
echo GCCH Enrollment Profile
|
||||
echo ========================================
|
||||
echo.
|
||||
echo 1. No Office
|
||||
echo 2. Standard Office (x86)
|
||||
echo 3. Standard Office (x64)
|
||||
echo 4. Pro Plus Office (x86) with Access
|
||||
echo 5. Pro Plus Office (x64) with Access
|
||||
echo 6. Skip enrollment
|
||||
echo.
|
||||
set /p enroll=Enter your choice (1-6):
|
||||
if "%enroll%"=="1" set PPKG=GCCH_Prod_SFLD_NoOffice_US_Exp_20260430_v4.8.ppkg
|
||||
if "%enroll%"=="2" set PPKG=GCCH_Prod_SFLD_StdOffice-x86_US_Exp_20260430_v4.8.ppkg
|
||||
if "%enroll%"=="3" set PPKG=GCCH_Prod_SFLD_StdOffice-x64_US_Exp_20260430_v4.8.ppkg
|
||||
if "%enroll%"=="4" set PPKG=GCCH_Prod_SFLD_ProPlusOffice-x86_US_Exp_20260430_v4.8.ppkg
|
||||
if "%enroll%"=="5" set PPKG=GCCH_Prod_SFLD_ProPlusOffice-x64_US_Exp_20260430_v4.8.ppkg
|
||||
if "%enroll%"=="6" set PPKG=
|
||||
if "%enroll%"=="" goto enroll_menu
|
||||
|
||||
:pctype_menu
|
||||
cls
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Shopfloor PC Type
|
||||
echo ========================================
|
||||
echo.
|
||||
echo 1. CMM
|
||||
echo 2. Wax and Trace
|
||||
echo 3. Keyence
|
||||
echo 4. Genspect
|
||||
echo 5. Display
|
||||
echo 6. Shopfloor (General)
|
||||
echo.
|
||||
set PCTYPE=
|
||||
set /p pctype_choice=Enter your choice (1-6):
|
||||
if "%pctype_choice%"=="1" set PCTYPE=CMM
|
||||
if "%pctype_choice%"=="2" set PCTYPE=WaxAndTrace
|
||||
if "%pctype_choice%"=="3" set PCTYPE=Keyence
|
||||
if "%pctype_choice%"=="4" set PCTYPE=Genspect
|
||||
if "%pctype_choice%"=="5" set PCTYPE=Display
|
||||
if "%pctype_choice%"=="6" set PCTYPE=Shopfloor
|
||||
if "%PCTYPE%"=="" goto pctype_menu
|
||||
|
||||
REM --- Display sub-type selection ---
|
||||
set DISPLAYTYPE=
|
||||
if not "%PCTYPE%"=="Display" goto skip_display_menu
|
||||
:display_menu
|
||||
cls
|
||||
echo.
|
||||
echo ========================================
|
||||
echo Display Type
|
||||
echo ========================================
|
||||
echo.
|
||||
echo 1. Lobby Display
|
||||
echo 2. Dashboard
|
||||
echo.
|
||||
set /p display_choice=Enter your choice (1-2):
|
||||
if "%display_choice%"=="1" set DISPLAYTYPE=Lobby
|
||||
if "%display_choice%"=="2" set DISPLAYTYPE=Dashboard
|
||||
if "%DISPLAYTYPE%"=="" goto display_menu
|
||||
:skip_display_menu
|
||||
|
||||
REM --- Map enrollment share early (kept open for copy after imaging) ---
|
||||
set NEED_ENROLL=0
|
||||
if not "%PPKG%"=="" set NEED_ENROLL=1
|
||||
if not "%PCTYPE%"=="" set NEED_ENROLL=1
|
||||
if "%NEED_ENROLL%"=="0" goto enroll_staged
|
||||
net use Y: \\10.9.100.1\enrollment /user:pxe-upload pxe /persistent:no
|
||||
if "%PPKG%"=="" goto enroll_staged
|
||||
if not exist "Y:\%PPKG%" (
|
||||
echo WARNING: %PPKG% not found on server. Enrollment will be skipped.
|
||||
set PPKG=
|
||||
)
|
||||
:enroll_staged
|
||||
|
||||
echo. > X:\Boot.tag
|
||||
if "%choice%"=="1" goto gea-standard
|
||||
if "%choice%"=="2" goto gea-engineer
|
||||
if "%choice%"=="3" goto gea-shopfloor
|
||||
if "%choice%"=="4" goto gea-shopfloor-mce
|
||||
if "%choice%"=="5" goto ge-standard
|
||||
if "%choice%"=="6" goto ge-engineer
|
||||
if "%choice%"=="7" goto ge-shopfloor-lockdown
|
||||
if "%choice%"=="8" goto ge-shopfloor-mce
|
||||
if "%choice%"=="4" goto ge-standard
|
||||
if "%choice%"=="5" goto ge-engineer
|
||||
if "%choice%"=="6" goto ge-shopfloor-lockdown
|
||||
if "%choice%"=="7" goto ge-shopfloor-mce
|
||||
echo Invalid choice. Please try again.
|
||||
pause
|
||||
goto menu
|
||||
@@ -62,14 +166,6 @@ for /l %%i in (1,1,2000000) do rem
|
||||
net use Z: \\10.9.100.1\winpeapps\gea-shopfloor /user:pxe-upload pxe /persistent:no
|
||||
goto end
|
||||
|
||||
:gea-shopfloor-mce
|
||||
echo.
|
||||
echo Starting GEA Shopfloor MCE setup...
|
||||
start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe
|
||||
for /l %%i in (1,1,2000000) do rem
|
||||
net use Z: \\10.9.100.1\winpeapps\gea-shopfloor-mce /user:pxe-upload pxe /persistent:no
|
||||
goto end
|
||||
|
||||
:ge-standard
|
||||
echo.
|
||||
echo Starting GE Standard setup...
|
||||
@@ -107,12 +203,70 @@ echo.
|
||||
echo Waiting for PESetup.exe to start...
|
||||
:wait_start
|
||||
ping -n 3 127.0.0.1 >NUL
|
||||
tasklist /FI "IMAGENAME eq PESetup.exe" 2>NUL | find /I "PESetup.exe" >NUL
|
||||
wmic process where "name='PESetup.exe'" get name 2>NUL | find /I "PESetup" >NUL
|
||||
if errorlevel 1 goto wait_start
|
||||
echo PESetup.exe is running. Waiting for imaging to complete...
|
||||
|
||||
REM --- Copy enrollment package and shopfloor setup as soon as Windows partition appears ---
|
||||
if "%PPKG%"=="" if "%PCTYPE%"=="" goto wait_finish
|
||||
echo Waiting for Windows partition at W: ...
|
||||
:wait_enroll
|
||||
ping -n 11 127.0.0.1 >NUL
|
||||
if not exist W:\Windows\System32\config\system goto wait_enroll
|
||||
echo Found Windows at W:
|
||||
mkdir W:\Enrollment 2>NUL
|
||||
|
||||
REM --- Copy PPKG if selected ---
|
||||
if "%PPKG%"=="" goto copy_pctype
|
||||
copy /Y "Y:\%PPKG%" "W:\Enrollment\%PPKG%"
|
||||
if errorlevel 1 (
|
||||
echo WARNING: Failed to copy enrollment package.
|
||||
goto copy_pctype
|
||||
)
|
||||
copy /Y "Y:\run-enrollment.ps1" "W:\run-enrollment.ps1"
|
||||
|
||||
REM --- Create enroll.cmd at drive root as manual fallback ---
|
||||
> W:\enroll.cmd (
|
||||
echo @echo off
|
||||
echo echo Waiting for network...
|
||||
echo :waitnet
|
||||
echo ping -n 2 8.8.8.8 ^>NUL 2^>^&1
|
||||
echo if errorlevel 1 goto waitnet
|
||||
echo echo Network connected. Running enrollment...
|
||||
echo powershell.exe -ExecutionPolicy Bypass -File "C:\run-enrollment.ps1"
|
||||
)
|
||||
echo Manual fallback created at W:\enroll.cmd
|
||||
|
||||
:copy_pctype
|
||||
REM --- Copy shopfloor PC type setup scripts ---
|
||||
if "%PCTYPE%"=="" goto cleanup_enroll
|
||||
echo %PCTYPE%> W:\Enrollment\pc-type.txt
|
||||
if not "%DISPLAYTYPE%"=="" echo %DISPLAYTYPE%> W:\Enrollment\display-type.txt
|
||||
copy /Y "Y:\shopfloor-setup\Run-ShopfloorSetup.ps1" "W:\Enrollment\Run-ShopfloorSetup.ps1"
|
||||
REM --- Always copy Shopfloor baseline scripts ---
|
||||
mkdir W:\Enrollment\shopfloor-setup 2>NUL
|
||||
if exist "Y:\shopfloor-setup\Shopfloor" (
|
||||
mkdir W:\Enrollment\shopfloor-setup\Shopfloor 2>NUL
|
||||
xcopy /E /Y /I "Y:\shopfloor-setup\Shopfloor" "W:\Enrollment\shopfloor-setup\Shopfloor\"
|
||||
echo Copied Shopfloor baseline setup files.
|
||||
)
|
||||
REM --- Copy type-specific scripts on top of baseline ---
|
||||
if "%PCTYPE%"=="Shopfloor" goto pctype_done
|
||||
if exist "Y:\shopfloor-setup\%PCTYPE%" (
|
||||
mkdir "W:\Enrollment\shopfloor-setup\%PCTYPE%" 2>NUL
|
||||
xcopy /E /Y /I "Y:\shopfloor-setup\%PCTYPE%" "W:\Enrollment\shopfloor-setup\%PCTYPE%\"
|
||||
echo Copied %PCTYPE% setup files.
|
||||
) else (
|
||||
echo WARNING: No setup files found for PC type %PCTYPE%.
|
||||
)
|
||||
:pctype_done
|
||||
|
||||
:cleanup_enroll
|
||||
net use Y: /delete 2>NUL
|
||||
|
||||
:wait_finish
|
||||
ping -n 11 127.0.0.1 >NUL
|
||||
tasklist /FI "IMAGENAME eq PESetup.exe" 2>NUL | find /I "PESetup.exe" >NUL
|
||||
wmic process where "name='PESetup.exe'" get name 2>NUL | find /I "PESetup" >NUL
|
||||
if not errorlevel 1 goto wait_finish
|
||||
echo.
|
||||
echo Imaging complete. Rebooting in 15 seconds...
|
||||
|
||||
Reference in New Issue
Block a user