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
|
|
|
|
set COMPANY_SETTINGS=..\company\settings.cmd
|
|
|
|
set LANG=en-US
|
|
|
|
set MYUSER=
|
|
|
|
set MYNAME=
|
|
|
|
set MYPASS=
|
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 15:11:28 +01:00
|
|
|
|
|
|
|
echo searching for COMPANY settings ...
|
|
|
|
if NOT EXIST %COMPANY_SETTINGS% (
|
|
|
|
echo INFO: config file %COMPANY_SETTINGS% NOT FOUND
|
|
|
|
) else (
|
|
|
|
echo OK. Loading COMPANY settings ...
|
|
|
|
call %COMPANY_SETTINGS%
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
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
|
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 15:11:28 +01:00
|
|
|
rem ask for user ...
|
|
|
|
if "@%localadmin%" NEQ "@" (
|
|
|
|
set MYUSER=%localadmin%
|
|
|
|
) else (
|
|
|
|
echo.
|
|
|
|
set /p MYUSER="Username (%MYUSER%)? "
|
|
|
|
)
|
|
|
|
|
|
|
|
rem ask for real name ...
|
|
|
|
if "@%localadmin_name%" NEQ "@" (
|
|
|
|
set MYNAME=%localadmin_name%
|
|
|
|
) else (
|
|
|
|
echo.
|
|
|
|
set /p MYNAME="Display Name (%MYNAME%)? "
|
|
|
|
)
|
|
|
|
|
|
|
|
rem ask for a password ...
|
|
|
|
if "@%localadmin_password%" NEQ "@" (
|
|
|
|
set MYPASS=%localadmin_password%
|
|
|
|
) else (
|
|
|
|
echo.
|
|
|
|
set /p MYPASS="Password (not set)? "
|
|
|
|
)
|
|
|
|
|
|
|
|
echo copying config for unattended install ...
|
|
|
|
copy /Y autounattend_BIOS_template.xml %BOOT%\autounattend_BIOS.xml
|
|
|
|
copy /Y autounattend_UEFI_template.xml %BOOT%\autounattend_UEFI.xml
|
|
|
|
echo.
|
|
|
|
|
|
|
|
rem prepare BIOS version ...
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend_BIOS.xml ___MYUSER___ "%MYUSER%"
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend_BIOS.xml ___MYNAME___ "%MYNAME%"
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend_BIOS.xml ___MYPASS___ "%MYPASS%" /S
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend_BIOS.xml ___MYLANG___ "%LANG%"
|
|
|
|
echo.
|
|
|
|
|
|
|
|
rem prepare UEFI version ...
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend_UEFI.xml ___MYUSER___ "%MYUSER%"
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend_UEFI.xml ___MYNAME___ "%MYNAME%"
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend_UEFI.xml ___MYPASS___ "%MYPASS%" /S
|
|
|
|
..\tools\searchreplace %BOOT%\autounattend_UEFI.xml ___MYLANG___ "%LANG%"
|
|
|
|
echo.
|
|
|
|
|
2023-01-02 16:00:47 +01:00
|
|
|
if EXIST ..\company\snapshot64.exe (
|
|
|
|
echo copying LICENSED snapshot64.exe to boot image ...
|
|
|
|
copy /Y ..\company\snapshot64.exe %BOOT%
|
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
|
|
|
|