62 lines
2.0 KiB
Batchfile
62 lines
2.0 KiB
Batchfile
@echo off
|
|
REM ElevationCheck
|
|
NET SESSION >nul 2>&1
|
|
IF %ERRORLEVEL% NEQ 0 (
|
|
ECHO Please run this script as administrator
|
|
PAUSE
|
|
EXIT
|
|
)
|
|
|
|
REM Buildconf
|
|
set BuildEdition=SMBInstaller
|
|
|
|
REM Setup Enviroment
|
|
REM Check if home has PEBuilderConfig if not check the current folder when no config was found quit
|
|
IF EXIST "%UserProfile%\PEBuilderConfig.cmd" (
|
|
call %UserProfile%\PEBuilderConfig.cmd
|
|
) ELSE (
|
|
IF EXIST "%~dp0\PEBuilderConfig.cmd" (
|
|
call "%~dp0\PEBuilderConfig.cmd"
|
|
) ELSE (
|
|
echo Config not found, exiting
|
|
pause
|
|
exit
|
|
)
|
|
)
|
|
call "%ADKPath%\Deployment Tools\DandISetEnv.bat"
|
|
set PEPath=C:\WinPE_%BuildEdition%
|
|
|
|
REM Prepeare PE
|
|
call copype amd64 %PEPath%
|
|
|
|
REM Mount WIM image
|
|
Dism /Mount-Image /ImageFile:"%PEPath%\media\sources\boot.wim" /index:1 /MountDir:"%PEPath%\mount"
|
|
|
|
REM Add PE-SMB Installer files
|
|
xcopy /E /I /H /Y "%~dp0Overlay" "%PEPath%\mount"
|
|
|
|
REM add WMI module
|
|
Dism /Add-Package /Image:"%PEPath%\mount" /PackagePath:"%ADKPath%\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab"
|
|
Dism /Add-Package /Image:"%PEPath%\mount" /PackagePath:"%ADKPath%\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab"
|
|
|
|
REM add WinPE-SecureStartup module
|
|
Dism /Add-Package /Image:"%PEPath%\mount" /PackagePath:"%ADKPath%\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-SecureStartup.cab"
|
|
Dism /Add-Package /Image:"%PEPath%\mount" /PackagePath:"%ADKPath%\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-SecureStartup_en-us.cab"
|
|
|
|
REM Unmount WIM image
|
|
Dism /Unmount-Image /MountDir:"%PEPath%\mount" /commit
|
|
Dism /Cleanup-Mountpoints
|
|
|
|
REM Create ISO (Disabled by default)
|
|
REM call MakeWinPEMedia /ISO %PEPath% "%~dp0Winpe%ADKVersion%_%BuildEdition%.iso"
|
|
|
|
REM Copy WIM File to output folder
|
|
echo Saving %~dp0Winpe%ADKVersion%_%BuildEdition%.wim
|
|
copy %PEPath%\media\sources\boot.wim %~dp0Winpe%ADKVersion%_%BuildEdition%.wim
|
|
|
|
REM remove BuildDir
|
|
rmdir /q /s %PEPath%
|
|
|
|
REM end
|
|
echo Done
|
|
pause |