diff --git a/03_DownloadAll.cmd b/02_DownloadAll.cmd similarity index 100% rename from 03_DownloadAll.cmd rename to 02_DownloadAll.cmd diff --git a/02_MakeAll.cmd b/03_MakeAll.cmd similarity index 100% rename from 02_MakeAll.cmd rename to 03_MakeAll.cmd diff --git a/06_PrepareStick.cmd b/06_Copy2Stick.cmd similarity index 100% rename from 06_PrepareStick.cmd rename to 06_Copy2Stick.cmd diff --git a/boot/autounattend_BIOS.xml b/boot/autounattend_BIOS.xml index 1a0b34a..5eaaf7a 100644 --- a/boot/autounattend_BIOS.xml +++ b/boot/autounattend_BIOS.xml @@ -4,12 +4,12 @@ <settings pass="windowsPE"> <component name="Microsoft-Windows-International-Core-WinPE" 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"> <SetupUILanguage> - <UILanguage>de-DE</UILanguage> + <UILanguage>en-US</UILanguage> </SetupUILanguage> <InputLocale>de-DE</InputLocale> <SystemLocale>de-DE</SystemLocale> <UILanguage>en-US</UILanguage> - <UserLocale>en-US</UserLocale> + <UserLocale>de-DE</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> @@ -85,7 +85,7 @@ <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" 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"> <InputLocale>de-DE</InputLocale> - <SystemLocale>en-US</SystemLocale> + <SystemLocale>de-DE</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>de-DE</UserLocale> </component> diff --git a/boot/autounattend_UEFI.xml b/boot/autounattend_UEFI.xml index c542229..77226b0 100644 --- a/boot/autounattend_UEFI.xml +++ b/boot/autounattend_UEFI.xml @@ -4,12 +4,12 @@ <settings pass="windowsPE"> <component name="Microsoft-Windows-International-Core-WinPE" 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"> <SetupUILanguage> - <UILanguage>de-DE</UILanguage> + <UILanguage>en-US</UILanguage> </SetupUILanguage> <InputLocale>de-DE</InputLocale> <SystemLocale>de-DE</SystemLocale> <UILanguage>en-US</UILanguage> - <UserLocale>en-US</UserLocale> + <UserLocale>de-DE</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> @@ -105,7 +105,7 @@ <settings pass="oobeSystem"> <component name="Microsoft-Windows-International-Core" 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"> <InputLocale>de-DE</InputLocale> - <SystemLocale>en-US</SystemLocale> + <SystemLocale>de-DE</SystemLocale> <UILanguage>en-US</UILanguage> <UserLocale>de-DE</UserLocale> </component> diff --git a/settings.cmd b/settings.cmd new file mode 100644 index 0000000..9382235 --- /dev/null +++ b/settings.cmd @@ -0,0 +1,2 @@ +set LANG=de-DE + diff --git a/source/installer.pb b/source/installer.pb index d66986f..858403a 100644 --- a/source/installer.pb +++ b/source/installer.pb @@ -4,55 +4,134 @@ ; LICENSE : GPL ; AUTHOR : Michael H.G. Schmidt ; EMAIL : michael@schmidt2.de -; DATE : 20210317 +; DATE : 20210320 ; ------------------------------------------------------------ ; -; preparations to use native "system" command... +; preparations to use native "system" command ... ImportC "msvcrt.lib" system(str.p-ascii) EndImport -; open window to hide all other windows on dekstop ... +; Get system drive +SYS$=GetEnvironmentVariable("SystemDrive") + +Procedure StartInstallation() + + Result = MessageRequester("+++ Windows 10 unattended Installation +++", + "This will install a new OS (unattended)" + Chr(13) + + "and it will DELETE all DATA an your [ C: ] Drive!", + #PB_MessageRequester_YesNo | #PB_MessageRequester_Info) + + If Result = #PB_MessageRequester_Yes + + Result = MessageRequester("Caution !", + "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") + End 0 + 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)) + + ; kill main window ... + CloseWindow(0) + + MessageRequester("END.","Press OK to shutdown your system.",#PB_MessageRequester_Info) + + End + +EndProcedure + + +Procedure StartCMD() + + ; start a command shell ... + 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") + +EndProcedure + + +; Button handler procedure +Procedure ButtonHandler() + + Select EventGadget() + + Case 0 + StartInstallation() + Case 1 + StartCMD() + Case 2 + StartSnapshot64() + + EndSelect + +EndProcedure + + +;;;;;;; +; MAIN +;;;;;;; + +; open window to hide all other windows on desktop ... OpenWindow(0, 0, 0, 0, 0, "", #PB_Window_BorderLess | #PB_Window_Maximize) ; set colour to windows blue ... SetWindowColor(0, RGB($00,$a2,$ed)) -Result = MessageRequester("+++ Windows 10 unattended Installation +++", - "This will install a new OS (unattended)" + Chr(13) + - "and it will DELETE all DATA an your [ C: ] Drive!", - #PB_MessageRequester_YesNo | #PB_MessageRequester_Info) +; Get window size +W = WindowWidth(0) +H = WindowHeight(0) -If Result = #PB_MessageRequester_Yes - - Result = MessageRequester("Caution !", - "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("x:\winsetup.exe") - End 0 - EndIf +; Shrink factor for buttons +S=0.1 -EndIf +; X and Y root +X0=W/2-(W*S/2) +Y0=H/2-(W*S/2) -; show abort message ... -OpenWindow(1, 0, 0, 270, 70, "Installation ABORTED", - #PB_Window_SystemMenu | #PB_Window_ScreenCentered) +; calculations for buttons +ButtonH=H*0.1 +ButtonW=W*0.1 +GAP=ButtonW*0.1 -If LoadFont(0, "System", 10) - SetGadgetFont(#PB_Default, FontID(0)) -EndIf +BX1=W/3 +BX2=BX1 + ButtonW + GAP +BX3=BX2 + ButtonW + GAP -TextGadget(0, 0, 20, 270, 30, "Please POWEROFF your system now!", #PB_Text_Center) +BY=H/2-ButtonH/2 -; wait forever (window cannot be closed by user) ... -Repeat : Until WaitWindowEvent() = True +; Create Buttons +ButtonGadget(0, BX1, BY, ButtonW, ButtonH, "INSTALL system", #PB_Button_MultiLine) +BindGadgetEvent(0, @ButtonHandler()) + +ButtonGadget(1, BX2, BY, ButtonW, ButtonH, "COMMAND shell"+Chr(13)+"(with network)", #PB_Button_MultiLine) +BindGadgetEvent(1, @ButtonHandler()) + +ButtonGadget(2, BX3, BY, ButtonW, ButtonH, "Snapshot 64"+Chr(13)+"(Backup/Restore)", #PB_Button_MultiLine) +BindGadgetEvent(2, @ButtonHandler()) + +; MAIN LOOP +Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow ; IDE Options = PureBasic 5.73 LTS (Windows - x64) -; CursorPosition = 32 -; FirstLine = 8 +; CursorPosition = 118 +; FirstLine = 86 +; Folding = - ; EnableXP \ No newline at end of file diff --git a/wim/finish-boot.cmd b/wim/finish-boot.cmd index 470e282..320d77d 100644 --- a/wim/finish-boot.cmd +++ b/wim/finish-boot.cmd @@ -2,14 +2,28 @@ set SOURCES=c:\TEMP\W10\sources set BOOT=c:\TEMP\BOOT +if EXIST ..\settings.cmd ( + call ..\settings.cmd +) else ( + set LANG=en-US +) +echo LANG=%LANG% + if NOT EXIST %BOOT%\winsetup.exe ( echo renaming Windows setup.exe to boot ... move /Y %BOOT%\setup.exe %BOOT%\winsetup.exe ) +echo setting language in boot ... +dism /image:%BOOT% /Set-InputLocale:%LANG% +dism /image:%BOOT% /Set-SysLocale:%LANG% + echo replacing setup.exe with our installer utility ... copy /Y installer.exe %BOOT%\setup.exe +echo copy snapshot64 to boot ... +copy /Y ..\software\snapshot64.exe %BOOT% + echo showing boot contents ... dir %BOOT% diff --git a/wim/installer.exe b/wim/installer.exe index 1ca7adc..19ffc92 100644 Binary files a/wim/installer.exe and b/wim/installer.exe differ diff --git a/wim/recompile.installer.cmd b/wim/recompile.installer.cmd new file mode 100644 index 0000000..d66d6a1 --- /dev/null +++ b/wim/recompile.installer.cmd @@ -0,0 +1,15 @@ +@echo off + +rem remount boot image and recompile installer ... + +del /F installer.exe 1>nul 2>nul +echo +++++++++++++++++++++++++++++++++++ +call pbc.cmd ..\source\installer.pb +echo +++++++++++++++++++++++++++++++++++ +call umount-all.cmd +echo +++++++++++++++++++++++++++++++++++ +call mount-boot.cmd +echo +++++++++++++++++++++++++++++++++++ +call finish-boot.cmd +echo +++++++++++++++++++++++++++++++++++ +