2021-03-16 23:23:06 +01:00
|
|
|
@echo off
|
2023-02-20 07:56:50 +01:00
|
|
|
set SOURCES=%SystemDrive%\TEMP\W10\sources
|
|
|
|
set BOOT=%SystemDrive%\TEMP\BOOT
|
2023-02-20 15:11:28 +01:00
|
|
|
set SCRIPT_SETTINGS=..\scripts\settings.cmd
|
2024-02-23 14:03:56 +01:00
|
|
|
set CUSTOM_SETTINGS=..\custom\settings.cmd
|
2023-02-20 15:11:28 +01:00
|
|
|
set LANG=en-US
|
2023-02-20 16:32:39 +01:00
|
|
|
set localadmin=localadmin
|
|
|
|
set localadmin_name=Local Administrator
|
|
|
|
set localadmin_password=
|
2021-03-16 23:23:06 +01:00
|
|
|
|
2023-02-20 15:11:28 +01:00
|
|
|
rem ===================
|
|
|
|
rem CONFIGFILE CHECK
|
|
|
|
rem ===================
|
|
|
|
|
|
|
|
echo searching for SCRIPT settings ...
|
|
|
|
if NOT EXIST %SCRIPT_SETTINGS% (
|
|
|
|
echo INFO: config file %SCRIPT_SETTINGS% NOT FOUND
|
2021-03-21 00:08:41 +01:00
|
|
|
) else (
|
2023-02-20 15:11:28 +01:00
|
|
|
echo OK. Loading SCRIPT settings ...
|
|
|
|
call %SCRIPT_SETTINGS%
|
2021-03-21 00:08:41 +01:00
|
|
|
)
|
2023-02-20 16:32:39 +01:00
|
|
|
echo.
|
2023-02-20 15:11:28 +01:00
|
|
|
|
2024-02-22 14:47:24 +01:00
|
|
|
echo searching for CUSTOM settings ...
|
|
|
|
if NOT EXIST %CUSTOM_SETTINGS% (
|
|
|
|
echo INFO: config file %CUSTOM_SETTINGS% NOT FOUND
|
2023-02-20 15:11:28 +01:00
|
|
|
) else (
|
2024-02-22 14:47:24 +01:00
|
|
|
echo OK. Loading CUSTOM settings ...
|
|
|
|
call %CUSTOM_SETTINGS%
|
2023-02-20 15:11:28 +01:00
|
|
|
)
|
2023-02-20 16:32:39 +01:00
|
|
|
echo.
|
2023-02-20 15:11:28 +01:00
|
|
|
|
|
|
|
rem ======
|
|
|
|
rem MAIN
|
|
|
|
rem ======
|
2021-03-21 00:08:41 +01:00
|
|
|
|
2021-03-16 23:23:06 +01:00
|
|
|
if NOT EXIST %BOOT%\winsetup.exe (
|
2022-12-29 10:49:17 +01:00
|
|
|
echo renaming Windows setup.exe to boot image ...
|
2021-03-16 23:23:06 +01:00
|
|
|
move /Y %BOOT%\setup.exe %BOOT%\winsetup.exe
|
2023-02-20 16:32:39 +01:00
|
|
|
echo.
|
2021-03-16 23:23:06 +01:00
|
|
|
)
|
|
|
|
|
2022-12-29 10:49:17 +01:00
|
|
|
echo setting language in boot image ...
|
2023-01-22 20:09:39 +01:00
|
|
|
dism /image:%BOOT% /Set-InputLocale:%LANG% || exit /b 1
|
|
|
|
dism /image:%BOOT% /Set-SysLocale:%LANG% || exit /b 1
|
2023-02-20 16:32:39 +01:00
|
|
|
echo.
|
2021-03-21 00:08:41 +01:00
|
|
|
|
2021-03-18 00:08:40 +01:00
|
|
|
echo replacing setup.exe with our installer utility ...
|
|
|
|
copy /Y installer.exe %BOOT%\setup.exe
|
2023-02-20 16:32:39 +01:00
|
|
|
echo.
|
2021-03-18 00:08:40 +01:00
|
|
|
|
2024-09-28 16:25:23 +02:00
|
|
|
rem prepare file for unattended installation ...
|
|
|
|
echo copying config file for unattended installation ...
|
2024-01-03 19:58:03 +01:00
|
|
|
copy /Y autounattend_template.xml %BOOT%\autounattend.xml
|
2023-02-20 16:32:39 +01:00
|
|
|
|
2024-09-28 16:25:23 +02:00
|
|
|
rem file in users and passwords ...
|
2024-01-03 19:58:03 +01:00
|
|
|
..\tools\searchreplace %BOOT%\autounattend.xml ___MYUSER___ "%localadmin%"
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend.xml ___MYNAME___ "%localadmin_name%"
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend.xml ___MYPASS___ "%localadmin_password%" /S
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend.xml ___MYLANG___ "%LANG%"
|
|
|
|
echo.
|
2023-02-20 15:11:28 +01:00
|
|
|
|
2024-09-28 16:25:23 +02:00
|
|
|
echo copying config file for disk format [ BIOS ]...
|
|
|
|
copy /Y format-BIOS.txt %BOOT%
|
|
|
|
echo copying config file for disk format [ UEFI ]...
|
|
|
|
copy /Y format-UEFI.txt %BOOT%
|
|
|
|
echo copying disk formatting script ...
|
|
|
|
copy /Y format-disk.cmd %BOOT%
|
|
|
|
|
|
|
|
rem provide snapshot64.exe ...
|
2024-02-22 14:50:02 +01:00
|
|
|
if EXIST ..\software\snapshot64_licensed.exe (
|
2023-01-02 16:00:47 +01:00
|
|
|
echo copying LICENSED snapshot64.exe to boot image ...
|
2024-02-22 14:50:02 +01:00
|
|
|
copy /Y ..\software\snapshot64_licensed.exe %BOOT%\snapshot64.exe
|
2021-03-28 19:40:24 +02:00
|
|
|
) else (
|
2023-01-02 16:00:47 +01:00
|
|
|
echo copying STANDARD snapshot64.exe to boot image ...
|
2021-03-28 19:40:24 +02:00
|
|
|
copy /Y ..\software\snapshot64.exe %BOOT%
|
|
|
|
)
|
2021-03-22 00:39:55 +01:00
|
|
|
|
2022-12-29 10:49:17 +01:00
|
|
|
echo copy netuse helper script to boot image ...
|
2021-03-22 00:39:55 +01:00
|
|
|
copy /Y netuse.cmd %BOOT%
|
2021-03-21 00:08:41 +01:00
|
|
|
|
2021-03-16 23:23:06 +01:00
|
|
|
echo unmounting and committing changes to %SOURCES%\boot.wim ...
|
2023-01-22 20:09:39 +01:00
|
|
|
dism /Unmount-Wim /MountDir:%BOOT% /Commit || exit /b 1
|
2021-03-16 23:23:06 +01:00
|
|
|
|