installer, script names etc.pp

This commit is contained in:
Michael H.G. Schmidt 2021-03-21 00:08:41 +01:00
parent 947cd6b80b
commit 4607d8469e
10 changed files with 147 additions and 37 deletions

View File

@ -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>

View File

@ -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>

2
settings.cmd Normal file
View File

@ -0,0 +1,2 @@
set LANG=de-DE

View File

@ -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

View File

@ -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%

Binary file not shown.

View File

@ -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 +++++++++++++++++++++++++++++++++++