[main]
Title=Create iso 
Description= Create a bootable iso file of the project
Selected=True
Level=8
Author=JFX,madmax, Kare
Version=12.1
Date=09.08.2022

[Interface]
pFrame1=Enabling Boot Prompt:,707070,0,0,10,10,370,60
pCheckBox1=False, 'Press any key to boot from CD or DVD',0,3,30,40,340,18
pcheckbox2=True,Show Progress,0,0,30,80,120,18
//
tEcho_1=Creating ISO file...
[Interface.07]
Description=Erstellt eine bootfähige ISO-Datei vom PE
pframe1=Aktivierung der Boot-Aufforderung:,707070,0,0,10,10,370,60
pcheckbox1=False,Drücken Sie eine beliebige Taste#$c um von CD oder DVD zu booten#$q,0,3,30,40,340,18
pcheckbox2=True,Zeige Fortschritt an,0,0,30,80,120,18
//
tEcho_1=ISO-Datei wird erstellt...

Panel=1

[process]

echo,%tEcho_1%
IF,Not,EXISTDIR,%ISOdir%,Then,DirMake,%ISodir%

set,%Bootloader%,#$qBOOT/etfsboot.com#$q

If,%pCheckBox1%,=,False,then
	FileDelete,%target_cd%\boot\bootfix.bin,1
	set,%EFIloader%,#$qefi/microsoft/boot/efisys_noprompt.bin#$q
Else
	filecopy,%SourceDir%\Boot\bootfix.bin,%target_cd%\Boot\
	FileSetAttrib,%target_cd%\Boot\bootfix.bin,-R
	set,%EFIloader%,#$qefi/microsoft/boot/efisys.bin#$q
End
String,%EfiReady%,Split,%ExtInfo%,:,5
If,%EfiReady%,=,0,Then,set,%EFIloader%,#$qBOOT/etfsboot.com#$q

//Fix 34KB ISO - lowercase etfsboot.com
FileRename,%target_cd%\Boot\etfsboot.com,%target_cd%\Boot\etfsboot.tmp
FileRename,%target_cd%\Boot\etfsboot.tmp,%target_cd%\Boot\etfsboot.com

fileRename,%Target_CD%\bootmgr,%Target_CD%\BOOTMGR

If,%pCheckBox2%,=,False,then
	set,%show%,hide
else
	set,%show%,show
end

if,%Multiboot%,=,Grub,then
	set,%Bootloader%,grldr
	filecopy,%Tools%\grldr,%Target_CD%\

	If,%EfiReady%,=,1,Then
		set,%EFIloader%,#$qefiboot.img#$q
		filecopy,%Tools%\grub\efi\efiboot.img,%Target_CD%\
	End
	Run,%ScriptFile%,SetGrub,%EfiReady%,--
End

// Bios
//ShellExecute,%show%,%Tools%\mkisofs.exe, -iso-level 4 -volid #$q%ProjectFolder%#$q -b %Bootloader% -no-emul-boot -boot-load-size 8 -hide boot.catalog -duplicates-once -o #$q%ISOfile%#$q #$q%Target_cd%#$q
// Bios+Efi
ShellExecute,%show%,%Tools%\mkisofs.exe,-iso-level 4 -D -b %Bootloader% -no-emul-boot -boot-load-size 8 -boot-load-seg 1984 -eltorito-alt-boot -b %EFIloader% -no-emul-boot -o #$q%ISOfile%#$q #$q%Target_cd%#$q
if,not,%exitcode%,=,0,then,Halt,Error mkisofs.exe


[SetGrub]

filedelete,%Target_CD%\menu.lst,1
filedelete,%Target_CD%\BOOT\grub\grub.cfg,1
filedelete,%Target_CD%\GFX-BOOT.GFX,1

// Grub4dos
set,%Bootfile%,BOOTMGR

FileRead,%MenuLst%,%Tools%\Grub\menu_grub.ini
FileRead,%MenuEntry%,%ProjectTemp%\MultiBoot\EntryGrub.ini
String,%MenuLst%,Replace,%MenuLst%,*--------*,%MenuEntry%
TxtAddline,%Target_CD%\menu.lst,%MenuLst%,Bottom
if,Existfile,%ProjectTemp%\MultiBoot\GFX-BOOT.GFX,then,Filecopy,%ProjectTemp%\MultiBoot\GFX-BOOT.GFX,%Target_CD%\

if,#1,=,1,then
	// Grub2
	Filecopy,%boot_win%\Boot\EFI\bootmgfw.efi,%Target_CD%\efi\microsoft\boot\
	if,#2,=,ufd,Then
		Filecopy,%Tools%\Grub\efi\boot\bootx64.efi,%Target_CD%\efi\boot\
		Filecopy,%Tools%\Grub\efi\boot\grubx64.efi,%Target_CD%\efi\boot\
	end
	Dircopy,%Tools%\Grub\theme,%Target_CD%\BOOT\grub\theme
	FileRead,%MenuLst%,%Tools%\Grub\menu_grub2.ini
	FileRead,%MenuEntry%,%ProjectTemp%\MultiBoot\EntryGrub2.ini
	String,%MenuLst%,Replace,%MenuLst%,*--------*,%MenuEntry%
	Dirmake,%Target_CD%\BOOT\grub\	
	TxtAddline,%Target_CD%\BOOT\grub\grub.cfg,%MenuLst%,Bottom
End

[Script-Pic]
0=2937,3728,ZLB64
1=eNql0nk81N0eB/Df2LJeS7Qoy0OSLGPsSZasQ5ZknbFU0tinbDO2plVFEcVkhKcQg0kYoyTFIEsPZRljxgyGRFEzxTQY5nqe173PP/ef+7r38z1/nPP6/HHe5/U6AqpgGpBzdYI6AaDtOb09gGALUDvhaOeg7hMeFhGHjEEiIsMT1KFxYQbqfhADQwggoAP2gND/me1bjkimR5yJPxeGvJCSbmQIgYC3lyFEHWJoaWRsCbGQ9AlPSNT3spd0cPRzPOHppW/oaGRn4WQCCLpATwAAJAr6K8C/AhISFhEV2yEuISkFAoRB/85/lHKAEEhYWEhEWFRURGS7ydjuABF5UYXfIHZiO0+e2aFxUdHoSt5jcc3jDR1K3h/ZB4zPxl+VkNy1e89eZa2D2od0DpuYmplbHLG0d3B0cnaBup7y8fXzDwiEhZ0LP4+IiIxKSExKRqFTUq9dv5F589btrPz7DwoKsQ+LcE/KKyqfVlXjaxqbiM2klhcvWzvJXd0973r7+odHRsco49QJ2gxrdu7T/OeFxS+cHz9XVrm/eGvr8ttkIRERYZEdf5JBQqg/3yMvIvobREzB7uSOMxd3ahhdEVc8nve4oUNC09ibrXQ2/qPkrgMmM1qcP9V/of8789X/Cf23+W+y4C0gLw7oAhbCoG29PCAsDwhogLQwaPuwvbcBNje0haleOzLT/Td/TwexC9PcdWGjCj+7xjm3l9LNwzRM10jnI4Z/rBX/Sk2631t320oAWC3lS7kYWBW1vV44UxW80b50djXtkphSbc/Vb1yXNTcWZlmGg/tFblEeIk+shMq+zTPJ4q4HKY/NhZ1JApvVYP3iyJp5VeqM0bAsbvmDYa/PCfGRqXD3wnclep2E5b4BlVaMC/8pBYMcojsf57iMxG7pSXGjn2YdM9p4GyrzR9N9bfkmGNpymHeYLVuAUiyWGPhGBpeFSnnoV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