w10install/image/finish-boot.cmd

86 lines
2.3 KiB
Batchfile
Raw Normal View History

@echo off
2023-02-20 07:56:50 +01:00
set SOURCES=%SystemDrive%\TEMP\W10\sources
set BOOT=%SystemDrive%\TEMP\BOOT
set SCRIPT_SETTINGS=..\scripts\settings.cmd
set COMPANY_SETTINGS=..\company\settings.cmd
set LANG=en-US
2023-02-20 16:32:39 +01:00
set localadmin=localadmin
set localadmin_name=Local Administrator
set localadmin_password=
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 (
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.
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%
)
2023-02-20 16:32:39 +01:00
echo.
rem ======
rem MAIN
rem ======
2021-03-21 00:08:41 +01:00
if NOT EXIST %BOOT%\winsetup.exe (
2022-12-29 10:49:17 +01:00
echo renaming Windows setup.exe to boot image ...
move /Y %BOOT%\setup.exe %BOOT%\winsetup.exe
2023-02-20 16:32:39 +01:00
echo.
)
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
2023-02-20 16:32:39 +01:00
rem prepare unattended xml files ...
for %%A in (
BIOS
UEFI
) do (
echo copying config file for unattended install [ %%A ]...
copy /Y autounattend_%%A_template.xml %BOOT%\autounattend_%%A.xml
rem prepare BIOS version ...
..\tools\searchreplace %BOOT%\autounattend_%%A.xml ___MYUSER___ "%localadmin%"
..\tools\searchreplace %BOOT%\autounattend_%%A.xml ___MYNAME___ "%localadmin_name%"
..\tools\searchreplace %BOOT%\autounattend_%%A.xml ___MYPASS___ "%localadmin_password%" /S
..\tools\searchreplace %BOOT%\autounattend_%%A.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
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