09-Setup-WaxAndTrace.ps1 Step 3: - Detect Mitutoyo's burn-time typo on 218-378-13 series cal discs (filenames carry a trailing space inside the probe ID component, e.g. "Linear_X_218-378-13 _100072210.txt"). Their own .NET Setup.exe calls FileSystemInfo.set_Attributes on the source path and throws System.ArgumentException because the path contains an embedded space component, crashing every cal apply on 218-378-13 bays (exit -532462766 = 0xE0434352, .NET unhandled exception). Confirmed via WER Event 1026 captured during today's WJF00159 imaging. - When the buggy filenames are detected, bypass the broken vendor Setup.exe and direct-copy data\*.* into C:\Program Files (x86)\MitutoyoApp\Formtracepak\data\, renaming each file to strip ' _' (space-underscore) -> '_'. Clear read-only attr on each landed file. Older 218-458A discs have clean filenames and still use the vendor Setup.exe path. waxtrace-manifest.json: - Drop DetectionValue=v14.15.26706 from both VC++ 2017 redist entries. Windows Update routinely bumps the VS14 runtime to 14.16+ / 14.3x+, the older Mitutoyo redist refuses to install over the newer (exit 1638 'Another version already installed') and the manifest engine marked it as failed even though the runtime was fine. Detection is now by registry-key+name presence, which any VC++ 2015-2022 redist satisfies (they are backward-compatible). startnet.cmd:prompt_waxtrace_asset: - Replace free-text input with select-waxtrace-asset.ps1 arrow-key picker driven from installers-post/waxtrace/calibrations/INDEX.csv. - Map Y: enrollment share early so the picker can read INDEX.csv. - Replace parens-in-parens block (echo of '(e.g. WJRP2335)' inside the if-paren caused 'to was unexpected at this time' parse error observed by tech mid-imaging) with goto-flow. - Fall back to free-text prompt if picker unavailable or operator presses Esc. select-waxtrace-asset.ps1: - Sort bays descending by asset tag so WJRP* lands at top of menu. - Also staged as gea-shopfloor-waxtrace/select-waxtrace-asset.ps1 so sync-waxtrace.sh ships it to installers-post/waxtrace/ on the share. sync-waxtrace.sh: - Push select-waxtrace-asset.ps1 next to INDEX.csv on the share. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
496 lines
20 KiB
Batchfile
496 lines
20 KiB
Batchfile
@echo off
|
|
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 172.16.9.1 >NUL 2>&1
|
|
if errorlevel 1 goto wait_net
|
|
echo Network ready.
|
|
|
|
REM --- BIOS update check (runs before imaging menu) ---
|
|
REM Mounts [winpeapps_bios] share. CRITICAL: do NOT call check-bios.cmd
|
|
REM inside an `if exist (...)` parens block - CMD's variable scoping for
|
|
REM CALLed scripts inside parens does not propagate BIOS_STATUS back to
|
|
REM this script reliably. Use goto-flow instead so the CALL runs at the
|
|
REM top scope and BIOS_STATUS persists.
|
|
set BIOS_STATUS=No BIOS check (share unavailable)
|
|
net use B: \\172.16.9.1\winpeapps_bios /user:pxe-upload pxe /persistent:no 2>NUL
|
|
if not exist B:\check-bios.cmd goto :bios_check_done
|
|
echo.
|
|
echo Checking for BIOS updates...
|
|
call B:\check-bios.cmd
|
|
:bios_check_done
|
|
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 (sub-menu)
|
|
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-7):
|
|
|
|
REM --- Shopfloor images (3,6,7) need GCCH enrollment + (for 3) PC-type sub-menu.
|
|
REM Choice 3 = GEA Shopfloor: drill into sub-menu first to pick the gea-shopfloor-*
|
|
REM sub-category, THEN the office menu, THEN machine number for collections+nocollections.
|
|
set PPKG=
|
|
if "%choice%"=="3" goto gea_shopfloor_submenu
|
|
if "%choice%"=="6" goto enroll_menu
|
|
if "%choice%"=="7" goto enroll_menu
|
|
goto enroll_staged
|
|
|
|
:gea_shopfloor_submenu
|
|
cls
|
|
echo.
|
|
echo ========================================
|
|
echo GEA Shopfloor PC Sub-Type
|
|
echo ========================================
|
|
echo.
|
|
echo 1. Machine with Collections (eDNC + UDC + Plant Apps)
|
|
echo 2. Machine without Collections (eDNC + Plant Apps, no UDC)
|
|
echo 3. Common (Timeclock, Lab; WJ Shopfloor only)
|
|
echo 4. Keyence (VR-3000 / VR-5000 / VR-6000 microscope)
|
|
echo 5. CMM (Hexagon PC-DMIS + Protect Viewer)
|
|
echo 6. Genspect
|
|
echo 7. Heattreat (placeholder)
|
|
echo 8. Wax and Trace
|
|
echo 9. Display (kiosk dashboard)
|
|
echo.
|
|
set PCTYPE=
|
|
set /p ges_choice=Enter your choice (1-9):
|
|
if "%ges_choice%"=="1" set PCTYPE=gea-shopfloor-collections
|
|
if "%ges_choice%"=="2" set PCTYPE=gea-shopfloor-nocollections
|
|
if "%ges_choice%"=="3" set PCTYPE=gea-shopfloor-common
|
|
if "%ges_choice%"=="4" set PCTYPE=gea-shopfloor-keyence
|
|
if "%ges_choice%"=="5" set PCTYPE=gea-shopfloor-cmm
|
|
if "%ges_choice%"=="6" set PCTYPE=gea-shopfloor-genspect
|
|
if "%ges_choice%"=="7" set PCTYPE=gea-shopfloor-heattreat
|
|
if "%ges_choice%"=="8" set PCTYPE=gea-shopfloor-waxtrace
|
|
if "%ges_choice%"=="9" set PCTYPE=gea-shopfloor-display
|
|
if "%PCTYPE%"=="" goto gea_shopfloor_submenu
|
|
if "%PCTYPE%"=="gea-shopfloor-display" goto display_submenu
|
|
if "%PCTYPE%"=="gea-shopfloor-keyence" goto keyence_submenu
|
|
goto enroll_menu
|
|
|
|
:keyence_submenu
|
|
cls
|
|
echo.
|
|
echo ========================================
|
|
echo Keyence Model
|
|
echo ========================================
|
|
echo.
|
|
echo 1. VR-3000 G2 (older microscope/profilometer line)
|
|
echo 2. VR-5000 (mid-range)
|
|
echo 3. VR-6000 (current line)
|
|
echo.
|
|
set KEYENCEMODEL=
|
|
set /p kmod_choice=Enter your choice (1-3):
|
|
if "%kmod_choice%"=="1" set KEYENCEMODEL=vr3000
|
|
if "%kmod_choice%"=="2" set KEYENCEMODEL=vr5000
|
|
if "%kmod_choice%"=="3" set KEYENCEMODEL=vr6000
|
|
if "%KEYENCEMODEL%"=="" goto keyence_submenu
|
|
echo Keyence model: %KEYENCEMODEL%
|
|
goto enroll_menu
|
|
|
|
:display_submenu
|
|
cls
|
|
echo.
|
|
echo ========================================
|
|
echo Display Kiosk Sub-Type
|
|
echo ========================================
|
|
echo.
|
|
echo 1. Dashboard (shop floor metrics dashboard)
|
|
echo 2. Lobby Display (lobby information screen)
|
|
echo.
|
|
set DISPLAYTYPE=
|
|
set /p disp_choice=Enter your choice (1-2):
|
|
if "%disp_choice%"=="1" set DISPLAYTYPE=Dashboard
|
|
if "%disp_choice%"=="2" set DISPLAYTYPE=Lobby
|
|
if "%DISPLAYTYPE%"=="" goto display_submenu
|
|
goto enroll_menu
|
|
|
|
: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):
|
|
|
|
REM --- PPKG configuration (constructed at menu time, see docs) ---
|
|
REM Vendor ships one source PPKG; we construct the BPRT-tagged filename
|
|
REM by filling in Office, Region, Expiry, Version on the target copy.
|
|
REM Update SOURCE_PPKG + PPKG_VER when a new PPKG is released.
|
|
set SOURCE_PPKG=GCCH_Prod_SFLD_v4.14.ppkg
|
|
set PPKG_VER=v4.14
|
|
set PPKG_EXP=20260831
|
|
set REGION=US
|
|
|
|
set OFFICE=
|
|
if "%enroll%"=="1" set OFFICE=NoOffice
|
|
if "%enroll%"=="2" set OFFICE=StdOffice-x86
|
|
if "%enroll%"=="3" set OFFICE=StdOffice-x64
|
|
if "%enroll%"=="4" set OFFICE=ProPlusOffice-x86
|
|
if "%enroll%"=="5" set OFFICE=ProPlusOffice-x64
|
|
if "%enroll%"=="6" set OFFICE=
|
|
if "%enroll%"=="" goto enroll_menu
|
|
|
|
set PPKG=
|
|
if not "%OFFICE%"=="" set PPKG=GCCH_Prod_SFLD_%OFFICE%_%REGION%_Exp_%PPKG_EXP%_%PPKG_VER%.ppkg
|
|
|
|
REM --- 2026-05-04 rename reorg: PCTYPE is set by gea_shopfloor_submenu above
|
|
REM (single string, e.g. gea-shopfloor-collections). pc-subtype.txt is no
|
|
REM longer written. DISPLAYTYPE IS still written (display-type.txt) when
|
|
REM PCTYPE=gea-shopfloor-display because Install-KioskApp.cmd needs Lobby
|
|
REM vs Dashboard to choose installer + Get-PCProfile builds Display-{type}
|
|
REM profile key.
|
|
set PCSUBTYPE=
|
|
|
|
REM --- Machine number / asset tag (only PC types that key per-machine config) ---
|
|
REM collections + nocollections = 4-digit machine number for shopfloor identification.
|
|
REM waxtrace = asset tag like WJRP2335 used to match per-machine cal ISO during
|
|
REM 09-Setup-WaxAndTrace.ps1. Cal ISO files are named
|
|
REM CAL-{asset_tag}_serial-*_probe-*.iso.
|
|
set MACHINENUM=9999
|
|
if /i "%PCTYPE%"=="gea-shopfloor-collections" goto prompt_machinenum
|
|
if /i "%PCTYPE%"=="gea-shopfloor-nocollections" goto prompt_machinenum
|
|
if /i "%PCTYPE%"=="gea-shopfloor-waxtrace" goto prompt_waxtrace_asset
|
|
goto skip_machinenum
|
|
:prompt_machinenum
|
|
echo.
|
|
set /p MACHINENUM=Enter machine number (digits, or Enter for 9999):
|
|
if "%MACHINENUM%"=="" set MACHINENUM=9999
|
|
echo Machine number: %MACHINENUM%
|
|
goto skip_machinenum
|
|
:prompt_waxtrace_asset
|
|
echo.
|
|
echo Loading Wax/Trace bay list from PXE share...
|
|
REM Mount enrollment share early so the picker can read INDEX.csv. Later
|
|
REM net use Y: will be a no-op if Y: is already mapped.
|
|
net use Y: \\172.16.9.1\enrollment /user:pxe-upload pxe /persistent:no >NUL 2>NUL
|
|
del X:\waxtrace-asset.txt 2>NUL
|
|
if not exist "Y:\installers-post\waxtrace\select-waxtrace-asset.ps1" goto waxtrace_picker_skip
|
|
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "Y:\installers-post\waxtrace\select-waxtrace-asset.ps1" -IndexPath "Y:\installers-post\waxtrace\calibrations\INDEX.csv" -OutFile "X:\waxtrace-asset.txt"
|
|
:waxtrace_picker_skip
|
|
set MACHINENUM=
|
|
if exist X:\waxtrace-asset.txt set /p MACHINENUM=<X:\waxtrace-asset.txt
|
|
if not "%MACHINENUM%"=="" goto waxtrace_have_asset
|
|
echo.
|
|
echo Picker unavailable or cancelled. Falling back to free-text prompt.
|
|
echo Wax/Trace bays use the asset tag, e.g. WJRP2335 or WJF00159, to pick
|
|
echo the right calibration ISO during shopfloor setup.
|
|
set /p MACHINENUM=Enter asset tag:
|
|
:waxtrace_have_asset
|
|
if "%MACHINENUM%"=="" echo WARNING: no asset tag entered - calibration apply will be skipped.
|
|
echo Asset tag: %MACHINENUM%
|
|
:skip_machinenum
|
|
|
|
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: \\172.16.9.1\enrollment /user:pxe-upload pxe /persistent:no
|
|
if "%PPKG%"=="" goto enroll_staged
|
|
if not exist "Y:\ppkgs\%SOURCE_PPKG%" (
|
|
echo WARNING: %SOURCE_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 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
|
|
|
|
:gea-standard
|
|
echo.
|
|
echo Starting GEA Standard setup...
|
|
start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe
|
|
for /l %%i in (1,1,2000000) do rem
|
|
net use Z: \\172.16.9.1\winpeapps\gea-standard /user:pxe-upload pxe /persistent:no
|
|
goto end
|
|
|
|
:gea-engineer
|
|
echo.
|
|
echo Starting GEA Engineer setup...
|
|
start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe
|
|
for /l %%i in (1,1,2000000) do rem
|
|
net use Z: \\172.16.9.1\winpeapps\gea-engineer /user:pxe-upload pxe /persistent:no
|
|
goto end
|
|
|
|
:gea-shopfloor
|
|
echo.
|
|
echo Starting GEA Shopfloor setup...
|
|
start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe
|
|
for /l %%i in (1,1,2000000) do rem
|
|
net use Z: \\172.16.9.1\winpeapps\gea-shopfloor /user:pxe-upload pxe /persistent:no
|
|
goto end
|
|
|
|
:ge-standard
|
|
echo.
|
|
echo Starting GE Standard setup...
|
|
start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe
|
|
for /l %%i in (1,1,2000000) do rem
|
|
net use Z: \\172.16.9.1\winpeapps\ge-standard /user:pxe-upload pxe /persistent:no
|
|
goto end
|
|
|
|
:ge-engineer
|
|
echo.
|
|
echo Starting GE Engineer setup...
|
|
start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe
|
|
for /l %%i in (1,1,2000000) do rem
|
|
net use Z: \\172.16.9.1\winpeapps\ge-engineer /user:pxe-upload pxe /persistent:no
|
|
goto end
|
|
|
|
:ge-shopfloor-lockdown
|
|
echo.
|
|
echo Starting GE Shopfloor Lockdown setup...
|
|
start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe
|
|
for /l %%i in (1,1,2000000) do rem
|
|
net use Z: \\172.16.9.1\winpeapps\ge-shopfloor-lockdown /user:pxe-upload pxe /persistent:no
|
|
goto end
|
|
|
|
:ge-shopfloor-mce
|
|
echo.
|
|
echo Starting GE Shopfloor MCE setup...
|
|
start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe
|
|
for /l %%i in (1,1,2000000) do rem
|
|
net use Z: \\172.16.9.1\winpeapps\ge-shopfloor-mce /user:pxe-upload pxe /persistent:no
|
|
goto end
|
|
|
|
:end
|
|
echo.
|
|
|
|
REM --- Push initial "WinPE staging" status to PXE webapp ---
|
|
REM Externalized to Y:\scripts\winpe-status-push.ps1 so future edits don't
|
|
REM require a boot.wim rebuild. Best-effort; the script logs to
|
|
REM X:\Windows\Temp\winpe-status-push.log and swallows all errors.
|
|
if exist "Y:\scripts\winpe-status-push.ps1" (
|
|
powershell -NoProfile -ExecutionPolicy Bypass -File "Y:\scripts\winpe-status-push.ps1"
|
|
)
|
|
|
|
echo Waiting for PESetup.exe to start...
|
|
:wait_start
|
|
ping -n 3 127.0.0.1 >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 site config (drives site-specific values in all setup scripts) ---
|
|
if exist "Y:\config\site-config.json" (
|
|
copy /Y "Y:\config\site-config.json" "W:\Enrollment\site-config.json"
|
|
echo Copied site-config.json.
|
|
) else (
|
|
echo WARNING: site-config.json not found on enrollment share.
|
|
)
|
|
|
|
REM --- Copy PPKG if selected (renames from SOURCE to BPRT-tagged filename) ---
|
|
if "%PPKG%"=="" goto copy_pctype
|
|
copy /Y "Y:\ppkgs\%SOURCE_PPKG%" "W:\Enrollment\%PPKG%"
|
|
if errorlevel 1 (
|
|
echo WARNING: Failed to copy enrollment package.
|
|
goto copy_pctype
|
|
)
|
|
copy /Y "Y:\scripts\run-enrollment.ps1" "W:\Enrollment\run-enrollment.ps1"
|
|
copy /Y "Y:\scripts\wait-for-internet.ps1" "W:\Enrollment\wait-for-internet.ps1"
|
|
copy /Y "Y:\scripts\migrate-to-wifi.ps1" "W:\Enrollment\migrate-to-wifi.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
|
|
REM 2026-05-04 rename reorg: pc-subtype.txt no longer written.
|
|
REM display-type.txt IS still written for gea-shopfloor-display because
|
|
REM Install-KioskApp.cmd reads it to pick Lobby vs Dashboard installer
|
|
REM and Get-PCProfile.ps1 reads it to build the Display-{type} profile key.
|
|
if not "%DISPLAYTYPE%"=="" echo %DISPLAYTYPE%> W:\Enrollment\display-type.txt
|
|
if not "%MACHINENUM%"=="" echo %MACHINENUM%> W:\Enrollment\machine-number.txt
|
|
REM Keyence model goes to BOTH keyence-model.txt (read by 09-Setup-Keyence) AND
|
|
REM pc-subtype.txt (read by GE-Enforce for per-model dispatch via existing
|
|
REM PCSubType wiring: looks for gea-shopfloor-keyence-<model>\manifest.json on share).
|
|
if not "%KEYENCEMODEL%"=="" (
|
|
echo %KEYENCEMODEL%> W:\Enrollment\keyence-model.txt
|
|
echo %KEYENCEMODEL%> W:\Enrollment\pc-subtype.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
|
|
copy /Y "Y:\shopfloor-setup\backup_lockdown.bat" "W:\Enrollment\shopfloor-setup\backup_lockdown.bat"
|
|
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 --- Always copy common/ (cross-PC-type GE-Enforce dispatcher + lib live here post-v2) ---
|
|
if exist "Y:\shopfloor-setup\common" (
|
|
mkdir W:\Enrollment\shopfloor-setup\common 2>NUL
|
|
xcopy /E /Y /I "Y:\shopfloor-setup\common" "W:\Enrollment\shopfloor-setup\common\"
|
|
echo Copied common setup files.
|
|
)
|
|
REM --- Copy _ntlars-backups (147 per-bay .reg files restored by gea-shopfloor-{collections,nocollections}\03-RestoreEDncConfig.ps1) ---
|
|
REM Same root level as common/, referenced by 03-RestoreEDncConfig.ps1 via Join-Path $PSScriptRoot '..\_ntlars-backups'.
|
|
if exist "Y:\shopfloor-setup\_ntlars-backups" (
|
|
mkdir W:\Enrollment\shopfloor-setup\_ntlars-backups 2>NUL
|
|
xcopy /E /Y /I "Y:\shopfloor-setup\_ntlars-backups" "W:\Enrollment\shopfloor-setup\_ntlars-backups\"
|
|
echo Copied _ntlars-backups.
|
|
)
|
|
REM --- Copy type-specific scripts on top of baseline ---
|
|
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%.
|
|
)
|
|
|
|
REM --- Stage preinstall bundle (apps installed locally to save Azure bandwidth) ---
|
|
if exist "Y:\pre-install\preinstall.json" (
|
|
mkdir W:\PreInstall 2>NUL
|
|
mkdir W:\PreInstall\installers 2>NUL
|
|
copy /Y "Y:\pre-install\preinstall.json" "W:\PreInstall\preinstall.json"
|
|
if exist "Y:\pre-install\installers" (
|
|
xcopy /E /Y /I "Y:\pre-install\installers" "W:\PreInstall\installers\"
|
|
echo Staged preinstall bundle to W:\PreInstall.
|
|
) else (
|
|
echo WARNING: Y:\pre-install\installers not found - preinstall.json staged without installers.
|
|
)
|
|
if exist "Y:\pre-install\udc-backups" (
|
|
xcopy /E /Y /I "Y:\pre-install\udc-backups" "W:\PreInstall\udc-backups\"
|
|
echo Staged UDC settings backups to W:\PreInstall\udc-backups.
|
|
)
|
|
) else (
|
|
echo No preinstall bundle on PXE server - skipping.
|
|
)
|
|
|
|
REM --- Stage CMM bootstrap bundle (CMM-type PCs only) ---
|
|
REM Copies the Hexagon installer bundle (~1.9 GB) from the PXE server enrollment
|
|
REM share onto the target disk so 09-Setup-CMM.ps1 can install from local disk.
|
|
REM The tsgwp00525 SFLD share that holds the canonical copy is not yet reachable
|
|
REM during shopfloor-setup (Azure DSC provisions those creds later), so this
|
|
REM bootstrap exists to get the first-install through. Post-imaging, the
|
|
REM unified GE-Enforce dispatcher takes over from the share for ongoing updates.
|
|
if /i not "%PCTYPE%"=="gea-shopfloor-cmm" goto skip_cmm_stage
|
|
if exist "Y:\installers-post\cmm\cmm-manifest.json" (
|
|
mkdir W:\CMM-Install 2>NUL
|
|
xcopy /E /Y /I "Y:\installers-post\cmm" "W:\CMM-Install\"
|
|
echo Staged CMM bootstrap to W:\CMM-Install.
|
|
) else (
|
|
echo WARNING: Y:\cmm-installers not found - CMM PC cannot install Hexagon apps at imaging time.
|
|
)
|
|
:skip_cmm_stage
|
|
|
|
REM --- Stage Keyence per-model bootstrap bundle (Keyence PCs only) ---
|
|
REM Copies only the selected model's MSI + Data cabs from the PXE enrollment
|
|
REM share to the target disk. installers-post/keyence/<model>/ contains:
|
|
REM manifest.json
|
|
REM installers/{MSI, Data1.cab, [Data11.cab for vr3000], 1033.mst}
|
|
REM drivers/ (vr6000 only - older external .inf; vr3000/vr5000 drivers
|
|
REM are embedded in their MSIs)
|
|
REM 09-Setup-Keyence.ps1 reads C:\Enrollment\keyence-model.txt to know which.
|
|
if /i not "%PCTYPE%"=="gea-shopfloor-keyence" goto skip_keyence_stage
|
|
if "%KEYENCEMODEL%"=="" goto skip_keyence_stage
|
|
if exist "Y:\installers-post\keyence\%KEYENCEMODEL%\manifest.json" (
|
|
mkdir W:\KeyenceInstall 2>NUL
|
|
mkdir W:\KeyenceInstall\%KEYENCEMODEL% 2>NUL
|
|
xcopy /E /Y /I "Y:\installers-post\keyence\%KEYENCEMODEL%" "W:\KeyenceInstall\%KEYENCEMODEL%\"
|
|
echo Staged Keyence %KEYENCEMODEL% bootstrap to W:\KeyenceInstall\%KEYENCEMODEL%\.
|
|
) else (
|
|
echo WARNING: Y:\installers-post\keyence\%KEYENCEMODEL% not found - Keyence %KEYENCEMODEL% cannot install at imaging time.
|
|
)
|
|
:skip_keyence_stage
|
|
|
|
REM --- Stage WaxTrace bootstrap bundle (wax/trace gea-shopfloor-waxtrace only) ---
|
|
REM Copies the FormTracePak master capture (~110 MB compressed) + HASP +
|
|
REM VC++ redists + per-machine cal ISOs from the enrollment share onto the
|
|
REM target disk so 09-Setup-WaxAndTrace.ps1 can install FormTracePak via
|
|
REM xcopy + reg-import (bypassing Mitutoyo's CD-ROM-bound VB6 wrapper).
|
|
if /i not "%PCTYPE%"=="gea-shopfloor-waxtrace" goto skip_waxtrace_stage
|
|
if exist "Y:\installers-post\waxtrace\waxtrace-manifest.json" (
|
|
mkdir W:\WaxTrace-Install 2>NUL
|
|
xcopy /E /Y /I "Y:\installers-post\waxtrace" "W:\WaxTrace-Install\"
|
|
echo Staged WaxTrace bootstrap to W:\WaxTrace-Install.
|
|
) else (
|
|
echo WARNING: Y:\installers-post\waxtrace not found - WaxTrace PC cannot install FormTracePak at imaging time.
|
|
)
|
|
:skip_waxtrace_stage
|
|
:pctype_done
|
|
|
|
REM --- BIOS update sub-stage push (fires AFTER W: copies complete) ---
|
|
REM check-bios.cmd drops X:\bios-fired.flag iff it actually flashed or
|
|
REM staged a firmware update. Reading the flag file is more reliable than
|
|
REM scanning BIOS_STATUS for substrings (caret escaping inside quoted SET
|
|
REM is subtle in WinPE cmd.exe). Push must happen before Y: cleanup since
|
|
REM the push script lives on the share.
|
|
if exist X:\bios-fired.flag (
|
|
if exist "Y:\scripts\winpe-status-push.ps1" (
|
|
powershell -NoProfile -ExecutionPolicy Bypass -File "Y:\scripts\winpe-status-push.ps1" -CurrentStage "WinPE: BIOS firmware update"
|
|
)
|
|
)
|
|
|
|
:cleanup_enroll
|
|
net use Y: /delete 2>NUL
|
|
|
|
:wait_finish
|
|
ping -n 11 127.0.0.1 >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...
|
|
echo Press Ctrl+C to cancel.
|
|
ping -n 16 127.0.0.1 >NUL
|
|
wpeutil reboot
|