@echo off ::================================================================================== :: This script is used by the Windows pre-installation environment to bootstrap the install process. :: This includes loading any out-of-box drivers found at CustomerDrvs at runtime. :: Disclaimer: Any modifications to this script are done at your own risk, and might cause issues in the WinPE .wim. :: This might lead to Windows installation failures through xClarity Administrator. ::=================================================================================== wpeinit powershell -command set-executionpolicy bypass currentuser start /min cmd echo Initializing WinPE for LXCA. Please wait....... FOR /F "tokens=*" %%A IN ('wmic csproduct get uuid /Format:list ^| FIND "="') DO SET %%A echo REGEDIT4 >> duiduuid.reg echo. >> duiduuid.reg echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters] >> duiduuid.reg echo "Dhcpv6DUID"=hex:00,04,%uuid:~0,2%,%uuid:~2,2%,%uuid:~4,2%,%uuid:~6,2%,%uuid:~9,2%,%uuid:~11,2%,%uuid:~14,2%,%uuid:~16,2%,%uuid:~19,2%,%uuid:~21,2%,%uuid:~24,2%,%uuid:~26,2%,%uuid:~28,2%,%uuid:~30,2%,%uuid:~32,2%,%uuid:~34,2% >> duiduuid.reg echo. >> duiduuid.reg regedit /s duiduuid.reg :: Find the optical drive set "optdrivecheck=" set "optdrive=" set "checkfile=" for /f "delims=" %%a in ('wmic cdrom get drive ^| find ":"') do (call :lxcafilecheck "%%a" & if defined optdrive goto:driverinstall) :: If we got here then we did not find any lxca mount optical drives. goto :optdrivemissing :lxcafilecheck set optdrivecheck=%~1 set optdrivecheck=%optdrivecheck: =% set checkfile=%optdrivecheck%\lxca.cfg if exist %checkfile% ( echo SUCCESS: Mounted lxca bootstrap iso found on optical drive: %optdrivecheck% set optdrive=%optdrivecheck% ) else ( echo Optical drive: %optdrivecheck% is not the lxca bootstrap iso. Continue searching... ) exit /b :: Install any OOB drivers that were specified :driverinstall for /f "delims=" %%d in ('dir /ad /s /b /on x:\drivers') do for %%f in ("%%d/*.inf") do drvload %%d\%%~nf%%~xf :: There is a timing issue where after loading drivers the cdrom takes a minute to be available, so wait... powershell -command Start-Sleep -s 10 echo Start the Windows setup installer..... call %optdrive%\dvdboot.cmd goto :done :optdrivemissing echo ERROR: Error finding the optical drive containing the lxca bootstrap iso. Ensure your WinPE boot file is valid and all media is unmounted. Can not continue the Windows install. pause :done