added UEFI compatibility

This commit is contained in:
Michael H.G. Schmidt 2024-09-28 16:25:23 +02:00
parent e2af554587
commit 4c50f00a0f
7 changed files with 47 additions and 50 deletions

View File

@ -44,6 +44,11 @@ set DISK=
goto askdisk
:CONT1
echo.
echo IMPORTANT: USE === fat32 === for UEFI systems!
echo WARNING: DO NOT(!) USE [ exfat ] for UEFI boot!
echo.
set FS=fat32
:askfs
echo.
@ -55,6 +60,7 @@ set FS=fat32
)
if /i "%FS%" EQU "exfat" (
echo IMPORTANT: some old BIOS versions can't use exfat!
echo WARNING: UEFI BIOS can't use exfat for booting!
GOTO CONT2
)
if /i "%FS%" EQU "" (

View File

@ -77,10 +77,6 @@ for %%P in (drivers scripts source optional personal apps custom) do (
)
)
echo.
echo deleting ftpsettings.cmd ...
del /F /Q %DRIVE%\tools\custom\ftpsettings.cmd
echo.
echo copying autoconfig starter script to %DRIVE% ...
copy /Y image\StartAutoConfig.cmd %DRIVE%\
@ -110,6 +106,12 @@ if EXIST %DRIVE%\tools\%SNAPCONTROL_INI% (
tools\searchreplace %DRIVE%\tools\%SNAPCONTROL_INI% "^.*MAILPASS.*=.*" "MailPass = DELETED"
)
echo.
echo CLEANUP ...
del /F /Q %DRIVE%\tools\custom\ftpsettings.cmd
del /F /Q %DRIVE%\Auto-Saved*.*
del /F /Q %DRIVE%\NTLite.log
echo.
echo ======
echo READY.

View File

@ -12,50 +12,11 @@
<UserLocale>___MYLANG___</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<Disk wcm:action="add">
<CreatePartitions>
<!-- System partition -->
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>128</Size>
<Type>Primary</Type>
</CreatePartition>
<!-- Windows partition -->
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<!-- System partition -->
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Format>NTFS</Format>
<Label>System</Label>
<Active>true</Active>
</ModifyPartition>
<!-- Windows partition -->
<ModifyPartition wcm:action="add">
<Order>2</Order>
<PartitionID>2</PartitionID>
<Letter>C</Letter>
<Label>Windows</Label>
<Format>NTFS</Format>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
<PartitionID>3</PartitionID>
</InstallTo>
<WillShowUI>OnError</WillShowUI>
</OSImage>

View File

@ -49,17 +49,25 @@ echo replacing setup.exe with our installer utility ...
copy /Y installer.exe %BOOT%\setup.exe
echo.
rem prepare unattended xml files ...
echo copying config file for unattended install [ BIOS ]...
rem prepare file for unattended installation ...
echo copying config file for unattended installation ...
copy /Y autounattend_template.xml %BOOT%\autounattend.xml
rem prepare BIOS version ...
rem file in users and passwords ...
..\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.
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 ...
if EXIST ..\software\snapshot64_licensed.exe (
echo copying LICENSED snapshot64.exe to boot image ...
copy /Y ..\software\snapshot64_licensed.exe %BOOT%\snapshot64.exe

16
image/format-disk.cmd Normal file
View File

@ -0,0 +1,16 @@
@echo off
wpeinit && echo INFO: wpeinit OK
wpeutil UpdateBootInfo > NUL && echo INFO: wpeutil UpdateBootInfo OK
for /f "tokens=2* delims= " %%A in ('reg query HKLM\System\CurrentControlSet\Control /v PEFIRMWAREType') do set FIRMWARE=%%B
if %FIRMWARE%==0x1 (
echo FIRMWARE=%FIRMWARE% [BIOS]
echo ==========================
diskpart /s %SystemDrive%\format-BIOS.txt
) else (
echo FIRMWARE=%FIRMWARE% [UEFI]
echo ==========================
diskpart /s %SystemDrive%\format-UEFI.txt
)

Binary file not shown.

View File

@ -30,9 +30,13 @@ Procedure StartInstallation()
"REALLY DELETE ALL Data on DRIVE [ C: ] ?",
#PB_MessageRequester_YesNo | #PB_MessageRequester_Warning)
; start installation ...
If Result = #PB_MessageRequester_Yes
; format disk ...
dummy=system(SYS$ + "\windows\system32\cmd.exe /C " + SYS$ + "\format-disk.cmd")
; start installation ...
dummy=system(SYS$ + "\winsetup.exe /unattend:" + SYS$ + "\autounattend.xml")
End
EndIf
@ -62,14 +66,14 @@ Procedure StartCMD()
#PB_MessageRequester_Info)
; start a command shell ...
dummy=system(SYS$ + "\windows\system32\cmd.exe /C start /D "+SYS$+"\ "+SYS$+"\windows\system32\cmd.exe /K wpeutil initializenetwork")
dummy=system(SYS$ + "\windows\system32\cmd.exe /C start /D " + SYS$ + "\ " + SYS$ + "\windows\system32\cmd.exe /K wpeutil initializenetwork")
EndProcedure
Procedure StartSnapshot64()
; start backup/restore program ...
dummy=system(SYS$ + "\windows\system32\cmd.exe /C start /D "+SYS$+"\ "+SYS$+"\snapshot64.exe")
dummy=system(SYS$ + "\windows\system32\cmd.exe /C start /D " + SYS$ + "\ " + SYS$ + "\snapshot64.exe")
EndProcedure