diff --git a/05_FormatMedia.cmd b/05_FormatMedia.cmd index 61c4b13..7592173 100644 --- a/05_FormatMedia.cmd +++ b/05_FormatMedia.cmd @@ -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 "" ( diff --git a/06_Copy2Media.cmd b/06_Copy2Media.cmd index 57da1a8..4638325 100644 --- a/06_Copy2Media.cmd +++ b/06_Copy2Media.cmd @@ -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. diff --git a/image/autounattend_template.xml b/image/autounattend_template.xml index 2daf84b..ec8525e 100644 --- a/image/autounattend_template.xml +++ b/image/autounattend_template.xml @@ -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> diff --git a/image/finish-boot.cmd b/image/finish-boot.cmd index 15ec748..9743863 100644 --- a/image/finish-boot.cmd +++ b/image/finish-boot.cmd @@ -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 diff --git a/image/format-disk.cmd b/image/format-disk.cmd new file mode 100644 index 0000000..17fe091 --- /dev/null +++ b/image/format-disk.cmd @@ -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 +) + diff --git a/image/installer.exe b/image/installer.exe index 2314c5e..eb7af87 100644 Binary files a/image/installer.exe and b/image/installer.exe differ diff --git a/source/installer.pb b/source/installer.pb index ff9bd40..3d205de 100644 --- a/source/installer.pb +++ b/source/installer.pb @@ -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