reorg: UEFI/BIOS selection is now in installer!
This commit is contained in:
parent
f347b3458d
commit
fdadd9aa03
@ -31,3 +31,4 @@ echo.
|
||||
echo ======
|
||||
echo READY.
|
||||
echo ======
|
||||
|
||||
|
@ -4,36 +4,12 @@ set W10=c:\TEMP\W10
|
||||
set SOURCES=%W10%\sources
|
||||
set BOOTFILE=boot.wim
|
||||
set IMAGEFILE=install.wim
|
||||
set SCRIPT_SETTINGS=scripts\settings.cmd
|
||||
set COMPANY_SETTINGS=company\settings.cmd
|
||||
set LANG=en-US
|
||||
rem set SCRIPT_SETTINGS=scripts\settings.cmd
|
||||
rem set COMPANY_SETTINGS=company\settings.cmd
|
||||
set FOURGB=4294967296
|
||||
set MYUSER=
|
||||
set MYNAME=
|
||||
set MYPASS=
|
||||
|
||||
IF %1.==. GOTO USAGE
|
||||
|
||||
rem ===================
|
||||
rem CONFIGFILE CHECK
|
||||
rem ===================
|
||||
|
||||
echo searching for SCRIPT settings ...
|
||||
if NOT EXIST %SCRIPT_SETTINGS% (
|
||||
echo INFO: config file %SCRIPT_SETTINGS% NOT FOUND
|
||||
) else (
|
||||
echo OK. Loading SCRIPT settings ...
|
||||
call %SCRIPT_SETTINGS%
|
||||
)
|
||||
|
||||
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%
|
||||
)
|
||||
|
||||
echo.
|
||||
echo =================================
|
||||
echo Copying all data to Media ...
|
||||
@ -57,20 +33,12 @@ echo.
|
||||
|
||||
rem get drive type (is it fat32 ?) ...
|
||||
for /f "tokens=5" %%A in ('@fsutil fsinfo volumeinfo %DRIVE%^|findstr /B "File System Name : "') do (@set DRIVETYPE=%%A)
|
||||
echo INFO: DRIVETPYE = [ %DRIVETYPE% ]
|
||||
echo DRIVETPYE = [ %DRIVETYPE% ]
|
||||
|
||||
rem =====
|
||||
rem MAIN
|
||||
rem =====
|
||||
|
||||
echo.
|
||||
echo IMPORTANT:
|
||||
echo How is your target media formatted?
|
||||
echo - use "exfat" for BIOS based installations only!
|
||||
echo - use "fat32" for UEFI based installations only!
|
||||
echo REASON: UEFI cannot read "exfat" filesystems and Windows setup will throw error code: 0x80042565
|
||||
echo.
|
||||
|
||||
rem check SOURCE for files LARGER 4 GB in case FAT32 was chosen ...
|
||||
if /i "%DRIVETYPE%" EQU "fat32" (
|
||||
for /f "tokens=*" %%F in ('"dir /S /B /A-D %W10%"') do if %%~zF GTR %FOURGB% (
|
||||
@ -79,53 +47,6 @@ if /i "%DRIVETYPE%" EQU "fat32" (
|
||||
)
|
||||
)
|
||||
|
||||
set answer=B
|
||||
:ask
|
||||
set /p answer="BIOS(default) or UEFI setup (B/U)? "
|
||||
if /i "%answer:~,1%" EQU "B" (
|
||||
echo selected: BIOS
|
||||
copy /Y image\autounattend_BIOS_template.xml %DRIVE%\autounattend.xml
|
||||
GOTO CONT
|
||||
)
|
||||
if /i "%answer:~,1%" EQU "U" (
|
||||
echo selected: UEFI
|
||||
copy /Y image\autounattend_UEFI_template.xml %DRIVE%\autounattend.xml
|
||||
GOTO CONT
|
||||
)
|
||||
echo Please type B for BIOS or U for UEFI setup.
|
||||
goto ask
|
||||
:CONT
|
||||
|
||||
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.
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYUSER___ "%MYUSER%"
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYNAME___ "%MYNAME%"
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYPASS___ "%MYPASS%" /S
|
||||
tools\searchreplace %DRIVE%\autounattend.xml ___MYLANG___ "%LANG%"
|
||||
|
||||
if NOT EXIST %SOURCES%\%BOOTFILE% (
|
||||
echo DOH! no %BOOTFILE% in [ %SOURCES% ] found
|
||||
exit /b
|
||||
@ -171,6 +92,13 @@ echo.
|
||||
echo putting copytools script to %DRIVE% ...
|
||||
copy /Y image\CopyTools.cmd %DRIVE%\
|
||||
|
||||
echo.
|
||||
echo IMPORTANT HINT:
|
||||
echo How is your target media formatted?
|
||||
echo - use "exfat" for BIOS based installations only!
|
||||
echo - use "fat32" for UEFI based installations only!
|
||||
echo REASON: UEFI cannot read "exfat" filesystems and Windows setup will throw error code: 0x80042565
|
||||
|
||||
echo.
|
||||
echo ======
|
||||
echo READY.
|
||||
|
@ -1,14 +1,36 @@
|
||||
@echo off
|
||||
set SOURCES=%SystemDrive%\TEMP\W10\sources
|
||||
set BOOT=%SystemDrive%\TEMP\BOOT
|
||||
set SETTINGS=..\scripts\settings.cmd
|
||||
set SCRIPT_SETTINGS=..\scripts\settings.cmd
|
||||
set COMPANY_SETTINGS=..\company\settings.cmd
|
||||
set LANG=en-US
|
||||
set MYUSER=
|
||||
set MYNAME=
|
||||
set MYPASS=
|
||||
|
||||
if EXIST %SETTINGS% (
|
||||
call %SETTINGS%
|
||||
rem ===================
|
||||
rem CONFIGFILE CHECK
|
||||
rem ===================
|
||||
|
||||
echo searching for SCRIPT settings ...
|
||||
if NOT EXIST %SCRIPT_SETTINGS% (
|
||||
echo INFO: config file %SCRIPT_SETTINGS% NOT FOUND
|
||||
) else (
|
||||
set LANG=en-US
|
||||
echo OK. Loading SCRIPT settings ...
|
||||
call %SCRIPT_SETTINGS%
|
||||
)
|
||||
echo LANG=%LANG%
|
||||
|
||||
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 ======
|
||||
|
||||
if NOT EXIST %BOOT%\winsetup.exe (
|
||||
echo renaming Windows setup.exe to boot image ...
|
||||
@ -22,6 +44,49 @@ dism /image:%BOOT% /Set-SysLocale:%LANG% || exit /b 1
|
||||
echo replacing setup.exe with our installer utility ...
|
||||
copy /Y installer.exe %BOOT%\setup.exe
|
||||
|
||||
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.
|
||||
|
||||
if EXIST ..\company\snapshot64.exe (
|
||||
echo copying LICENSED snapshot64.exe to boot image ...
|
||||
copy /Y ..\company\snapshot64.exe %BOOT%
|
||||
|
Binary file not shown.
@ -4,7 +4,7 @@
|
||||
; LICENSE : GPL
|
||||
; AUTHOR : Michael H.G. Schmidt
|
||||
; EMAIL : michael@schmidt2.de
|
||||
; DATE : 20210322
|
||||
; DATE : 20230220
|
||||
; ------------------------------------------------------------
|
||||
;
|
||||
|
||||
@ -14,9 +14,9 @@ ImportC "msvcrt.lib"
|
||||
EndImport
|
||||
|
||||
; Get system drive
|
||||
SYS$=GetEnvironmentVariable("SystemDrive")
|
||||
Global SYS$=GetEnvironmentVariable("SystemDrive")
|
||||
|
||||
Procedure StartInstallation()
|
||||
Procedure StartInstallation(mode$)
|
||||
|
||||
Result = MessageRequester("+++ Windows 10 unattended Installation +++",
|
||||
"This will install a new OS (unattended)" + Chr(13) +
|
||||
@ -29,15 +29,15 @@ Procedure StartInstallation()
|
||||
"LAST WARNING:" + Chr(13) +
|
||||
"REALLY DELETE ALL Data on DRIVE [ C: ] ?",
|
||||
#PB_MessageRequester_YesNo | #PB_MessageRequester_Warning)
|
||||
|
||||
|
||||
; start installation ...
|
||||
If Result = #PB_MessageRequester_Yes
|
||||
dummy=system(SYS$ + "\winsetup.exe")
|
||||
dummy=system(SYS$ + "\winsetup.exe /unattend:" + SYS$ + "\autounattend_" + mode$ + ".xml")
|
||||
End
|
||||
EndIf
|
||||
|
||||
|
||||
EndIf
|
||||
|
||||
|
||||
; new fullscreen window with red colour ...
|
||||
OpenWindow(10, 0, 0, 0, 0, "", #PB_Window_BorderLess | #PB_Window_Maximize)
|
||||
SetWindowColor(10, RGB($FF,$00,$00))
|
||||
@ -51,7 +51,6 @@ Procedure StartInstallation()
|
||||
|
||||
EndProcedure
|
||||
|
||||
|
||||
Procedure StartCMD()
|
||||
|
||||
MessageRequester("HELP. Please read me 1st.",
|
||||
@ -67,7 +66,6 @@ Procedure StartCMD()
|
||||
|
||||
EndProcedure
|
||||
|
||||
|
||||
Procedure StartSnapshot64()
|
||||
|
||||
; start backup/restore program ...
|
||||
@ -75,24 +73,24 @@ Procedure StartSnapshot64()
|
||||
|
||||
EndProcedure
|
||||
|
||||
|
||||
; Button handler procedure
|
||||
Procedure ButtonHandler()
|
||||
|
||||
Select EventGadget()
|
||||
|
||||
Case 0
|
||||
StartInstallation()
|
||||
StartInstallation("BIOS")
|
||||
Case 1
|
||||
StartCMD()
|
||||
StartInstallation("UEFI")
|
||||
Case 2
|
||||
StartCMD()
|
||||
Case 3
|
||||
StartSnapshot64()
|
||||
|
||||
EndSelect
|
||||
|
||||
EndProcedure
|
||||
|
||||
|
||||
;;;;;;;
|
||||
; MAIN
|
||||
;;;;;;;
|
||||
@ -119,26 +117,31 @@ ButtonH=H*0.1
|
||||
ButtonW=W*0.1
|
||||
GAP=ButtonW*0.1
|
||||
|
||||
BX1=W/3
|
||||
BX0=W/4
|
||||
BX1=BX0 + ButtonW + GAP
|
||||
BX2=BX1 + ButtonW + GAP
|
||||
BX3=BX2 + ButtonW + GAP
|
||||
|
||||
BY=H/2-ButtonH/2
|
||||
|
||||
; Create Buttons
|
||||
ButtonGadget(0, BX1, BY, ButtonW, ButtonH, "INSTALL system", #PB_Button_MultiLine)
|
||||
ButtonGadget(0, BX0, BY, ButtonW, ButtonH, "INSTALL (BIOS mode)", #PB_Button_MultiLine)
|
||||
BindGadgetEvent(0, @ButtonHandler())
|
||||
|
||||
ButtonGadget(1, BX2, BY, ButtonW, ButtonH, "COMMAND shell"+Chr(13)+"(with network)", #PB_Button_MultiLine)
|
||||
ButtonGadget(1, BX1, BY, ButtonW, ButtonH, "INSTALL (UEFI mode)", #PB_Button_MultiLine)
|
||||
BindGadgetEvent(1, @ButtonHandler())
|
||||
|
||||
ButtonGadget(2, BX3, BY, ButtonW, ButtonH, "Snapshot 64"+Chr(13)+"(Backup/Restore)", #PB_Button_MultiLine)
|
||||
ButtonGadget(2, BX2, BY, ButtonW, ButtonH, "COMMAND shell"+Chr(13)+"(with network)", #PB_Button_MultiLine)
|
||||
BindGadgetEvent(2, @ButtonHandler())
|
||||
|
||||
ButtonGadget(3, BX3, BY, ButtonW, ButtonH, "Snapshot 64"+Chr(13)+"(Backup/Restore)", #PB_Button_MultiLine)
|
||||
BindGadgetEvent(3, @ButtonHandler())
|
||||
|
||||
; MAIN LOOP
|
||||
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
|
||||
|
||||
; IDE Options = PureBasic 5.73 LTS (Windows - x64)
|
||||
; CursorPosition = 6
|
||||
; CursorPosition = 123
|
||||
; FirstLine = 96
|
||||
; Folding = -
|
||||
; EnableXP
|
Loading…
Reference in New Issue
Block a user