[Main]
Title=Preconfig
Description=Getting some informations
Selected=none
Level=1
Author=Kare
Version=7.1
Date=04.07.2025
Translation_DE=MaineCoon

[Interface]
Panel=1
pCheckBox1=True,Remove old project,1:0,3,25,25,155,18
pTextLabel1=Windows,10,1:0,Default,45,101,70,20
pScrollBox1=,0,1:0,0,120,100,250,20,

tHalt_1=Administrator rights necessary
tHalt_2=WinCD Error: Please check your Windows Source CD

tEcho_1=Removing old Project Datas...
tEcho_2=Retrieving Windows CD...
tEcho_3=[%targetdir%]: Creating directories...
tEcho_5=download 7z...
tEcho_6=decompress 7z...
tHalt_9=Not enough free disk space.#$x#$xPresent:  %FSize% MB#$xNeeded:     %PSize% MB

[Interface.07]
Description=Sammelt Informationen von der Quell-DVD
Panel=1
pCheckBox1=True,Altes Projekt löschen,1:0,3,25,25,155,18
pTextLabel1=Windows,10,1:0,Default,45,101,70,20
pScrollBox1=,0,1:0,0,120,100,250,20,
//
tHalt_1=Administratorrechte notwendig
tHalt_2=WinCD-Fehler: Überprüfen Sie bitte Ihre Windows Quell-CD
tHalt_9=Nicht genügend freier Festplattenspeicher.#$x#$xVorhanden:  %FSize% MB#$xBenötigt:      %PSize% MB

tEcho_1=Altes Projekt wird gelöscht...
tEcho_2=Windows-CD wird überprüft...
tEcho_3=[%targetdir%]: Erstelle Verzeichnise...
tEcho_5=Lade 7z...
tEcho_6=Entpacke 7z...


[process]

// ********** Start Windows PE ************

Echo,%tEcho_1%
If,%Hostadmin%,=,0,then,Halt,%tHalt_1%

// get 7z
If,Not,ExistFile,%AppsDir%\7z\Files\7-Zip\7z.exe,then,run,%scriptfile%,Get7z

RegUnLoad,PE-SYSTEM
RegUnLoad,PE-SOFTWARE
RegUnLoad,PE-USER

If,not,ExistFile,%SourceDir%\setup.exe,then,Halt,%tHalt_2%
If,not,ExistDir,%SourceDir%\AMD64,then
	Set,%SystemWin%,%SystemDrv%\i386,Permanent
Else
	set,%source_win%,%SourceDir%\AMD64,Permanent
	set,%source_Sys%,%SourceDir%\AMD64,Permanent
	set,%target_win%,%TargetDir%\AMD64,permanent
	set,%target_sys%,%TargetDir%\AMD64\System32,Permanent
	Set,%SystemWin%,%SystemDrv%\AMD64,Permanent
End

//Macro
SetMacro,RunFromRAM,Run,%ProjectDir%\Macro.srt,RunFromRAM,#1,PERMANENT
SetMacro,SetProg32,Run,%ProjectDir%\Macro.srt,Process_SetProg32,#1,PERMANENT

Echo,%tEcho_2%
CopyOrExpand,%source_win%\SHELL32.DLL,%ProjectTemp%
Shellexecute,hide,%tools%\%Projectfolder%\GetWinCD.exe,#$q%SourceDir%#$q #$q%ProjectTemp%\SHELL32.DLL#$q #$q%Projectini%#$q Variables
if,not,%exitcode%,=,0,then,halt,%tHalt_1% 
filedelete,%ProjectTemp%\SHELL32.DLL
Update,ProjectVar

// Remove junction without ramdisk
Junc,GetTarget,%TargetDir%,%tmp%
if,not,%TargetDir%,=,%tmp%,Then
  if,not,ExistDir,%tmp%,then,DirRemove,%TargetDir%,3
end

//echo, Remove old Project...
if,%pCheckBox1%,=,true,then
	Echo,%tEcho_1%
	DirRemove,%TargetDir%\,7
	DirRemove,%Target_CD%\,3
end
FileDelete,%ProjectTemp%\MultiBoot\menu.lst,1

// Calc Hdd Size in MB
system,GetPrjSize,%Var%,1:2:3:4:5:6:7,mb
// TargetWin
String,%TWSize%,Split,%Var%,:,1
// Target_CD
String,%TCSize%,Split,%Var%,:,2
System,SwitchScript,%ProjectDir%\project.man
Interface,GetIndex,,pScrollBox1,%Tmp%
System,SwitchScript,Back,Tmp
if,%Tmp%,=,1,Then
  Math,%TWSize%,%TWSize%+%TCSize%
  Set,%TCSize%,0
End
// Provide Apps
String,%APSize%,Split,%Var%,:,3

Math,%PSize%,%TWSize%+%TCSize%+%APSize%
// ISo size
If,SrtChecked,Finish\1-create_iso.srt,then,Math,%PSize%,%PSize%+%PSize%+1,Round_Up

String,%Drive%,Left,%BaseDir%,2
System,GetFreeSpace,%Drive%,%FSize%
if,%PSize%,>,%FSize%,Then,Message,%tHalt_9%,Warning|LSP
//echo,%TCSize%
//Message,TargetWin:   	%TWSize% MB#$xTarget_CD: 	%TCSize% MB#$xAPPDir:	 	%APSize% MB#$x#$xProjectsize inkl. iso: %PSize% MB#$xFreesize:		%FSize% MB,Speicherverbrauch

DirMake,%TargetDir%
DirMake,%TargetDir%_CD

[Get7z]

Set,%7zFile%,7z2501.msi
set,%UrlPath_1%,https://7-zip.org/a/%7zFile%

if,not,ExistFile,%BaseDir%\Temp\Files\%7zFile%,then
  echo,%tEcho_5%
  WebGet,%UrlPath_1%,%BaseDir%\Temp\Files\%7zFile%,1
end
Dirmake,%appsdir%\7z
echo,%tEcho_6%
ShellExecute,hide,%WindowsDir%\system32\msiexec.exe, /a #$q%BaseDir%\Temp\Files\%7zFile%#$q /qn TARGETDIR=#$q%appsdir%\7z#$q
FileCopy,%appsdir%\7z\Files\7-Zip\7z.dll,%tools%\
FileCopy,%appsdir%\7z\Files\7-Zip\7z.exe,%tools%\
FileCopy,%appsdir%\7z\Files\7-Zip\7z.sfx,%tools%\

[Script-Pic]
0=3774,3136,ZLB64
1=eNq9l31UHOUVxp9UW21r2/Skx1M1Pdhqv6yt9ljbHnta29jYRI3HGL9KTQ21JmoTtICEJJAPs4BBNiQQQjaQLOzyEQKuMAO7DLs0u3yEnVlCAkSNwG7YCcybsCNLSFDIgvTObkIAa/X0j97Zmbvz8rvPfeadmZ0BmEfL3XeDttfj0NeBGwH8iFYawipExsPxZVyNeZdXiufvvwsJD96JNYt/gRefehRrVz6NV1b9GfGrViDp5RjExv4TcXHxSExMwqbkzah48SHY1z2I12NXIT3hBbyZ8HfsSFyLzA1rsXfjauQkv4SClBfxRkoitm5IQsu6B9D4ysM4GvcgxLjFaE5YCvG1pTi2cRlObHoYTeufgrj+MUjJT+Jo8rOQUv4K49aXoX89EVm6Dcje9ip26Tbh4M4tMKW+BlNGAkozk1GemQJOnwB+5waYd6XAlr0RQm4yHPkp6Ni6Al2Zz0Ha9jw8O2LQvmM1POmvQH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eplH7Lnj3qZhTT+8BgOsZ/r0Eq/pyxpMaGQRyxes6B5WhzV9pgaZ/aWr13OjNsamcY9HpFU6+ePH7D0qoxqf6suOicEsfWmaJm2vh85C6+EnfvLUhormo82lr0WvvGvG/SVp+j66aZg3LE80/WKoas+eJ55e/uijT0c/E126aSZP+j5SlzRlr0aSiWGVma0ZlbuiV//lnm6lLXnm80KzT1xvMDisBbUT3YJQJzH13LlhcavEgm322byiDA8HCWQet8tNQU20WpW1mi30661YZz/utAYic4keuqfUy03oeNyS1MbIHFO3zX2aMplOGmEhIrXp9HipMBgeoMvP8snHb0jVri+aTOoeDNIdOqxdIBSf/iagykrEi3byZOVzvGgE1aDyWRy9AzVpr0FTUxPzIrkPW8IZiNLy8OVM7DW0GdP+baLcNyc7/w8ZV/KWOfn+OTnqf8xzdbbM6ftf/M2cD22ehi/nCcrXUf4YkTmdctL0hud1S/j1899rR/n4

[Script-Select]
if,%Arch%,=,,Then
  if,not,%pScrollBox1%,=,,then,Interface,,Set,pScrollBox1,,
Else
  String,%pos%,Find,%pScrollBox1%,%os%
  if,%pos%,=,0,then
    Set,%Tmp%,%OS% (%Arch% %DistLang% %SP% %WIM_BUILD%)
    Interface,Set,,pScrollBox1,,%Tmp%
  End
End