[main]
title=Create ISO/CD/USB
description=
Selected=True
Level=8
Author=NightMan
Contact=vistape@vistape.net
Credits=
Locked=false
Version=12
Date=05.06.2008
Updates=
Download_Level=0
Mandatory=True

[Interface]
pTextBox1="Volume name",1,0,12,31,198,21,VistaPE
pButton1="Create a new ISO file",1,8,237,25,150,30,process
pCheckBox1="Show mkISOfs window",1,3,15,70,129,18,True
pTextLabel6="This option lets you choose if you want to run silently mkISOfs. This procedure can take much time if your build is too big and Winbuilder seems to hang!",1,1,147,74,333,42,8,Normal
pCheckBox2="Burn ISO",1,3,16,151,122,18,False
pButton2="Burn current ISO",1,8,147,145,120,25,BurnIso
pFileBox1=I:\,1,13,34,223,198,28,dir
pTextLabel1="Please select the root directory of your USB-Device",1,1,14,200,272,19,8,Normal
pButton3="Make USB boot device",1,8,288,205,149,25,MakeUSB
pBevel1=pBevel1,1,12,6,197,441,68
pButton4="Copy files (only)",1,8,287,235,150,25,CopyUSB

[variables]
%sizeFolder%
%sizeISO%

[CopyUSB]
Echo,"Preraring..."
ReadENV
If,"%BuildModel%",Equal,"Normal",Run,%ScriptFile%,USBError
If,ExistDir,"%TargetDir%\Drivers",Run,%ScriptFile%,MakeDrvIndex
DirMake,"%TempFolder%\USB"
ExtractAllFilesIfNotExist,"%ScriptFile%","USB","%TempFolder%\USB"
#
Echo,"Copy files..."
ShellExecute,Open,"%TempFolder%\USB\robocopy.exe","#$q%TargetDir%#$q #$q%pFileBox1%\#$q /MIR /FFT"
#
Echo,"Postprocess..."
FileDelete,"%TempFolder%\USB\grubinst.exe"
FileDelete,"%TempFolder%\USB\grubinst_gui.exe"
FileDelete,"%TempFolder%\USB\HPUSBFW.EXE"
FileDelete,"%TempFolder%\USB\hpusbfw_eula.rtf"
FileDelete,"%TempFolder%\USB\robocopy.exe"
#
If,ExistFile,"%TargetDir%\boot\grldr",FileCopy,"%TargetDir%\boot\grldr","%pFileBox1%\GRLDR"
Message,"All done!"

[MakeUSB]
Echo,"Preraring..."
ReadENV
If,"%BuildModel%",Equal,"Normal",Run,%ScriptFile%,USBError
If,ExistDir,"%TargetDir%\Drivers",Run,%ScriptFile%,MakeDrvIndex
DirMake,"%TempFolder%\USB"
ExtractAllFilesIfNotExist,"%ScriptFile%","USB","%TempFolder%\USB"
Echo,"Formating..."
Message,"Please format USB drive. NTFS is recommend, but FAT32 is work too :)"
ShellExecute,Open,"%TempFolder%\USB\HPUSBFW.exe" -f,"#$q%pFileBox1% #$q"
#
Echo,"Copy files..."
ShellExecute,Open,"%TempFolder%\USB\robocopy.exe","#$q%TargetDir%#$q #$q%pFileBox1% #$q /MIR /FFT"
#TODO
Echo,"Preraring boot manager..."
#If,"%BuildModel%",Equal,"MultiBoot",Run,%ScriptFile%,AutoBootMGR
#If,"%BuildModel%",Equal,"RAM",Set,%BootSect%,"boot/etfsboot.com"
If,ExistFile,"%TargetDir%\boot\grldr",FileCopy,"%TargetDir%\boot\grldr","%pFileBox1%\GRLDR"
If,ExistFile,"%pFileBox1%\GRLDR",ShellExecute,Open,"%TempFolder%\USB\grubinst_gui.exe"
If,NotExistFile,"%pFileBox1%\GRLDR",Run,%ScriptFile%,StandardBM
#
Echo,"Postprocess..."
FileDelete,"%TempFolder%\USB\grubinst.exe"
FileDelete,"%TempFolder%\USB\grubinst_gui.exe"
FileDelete,"%TempFolder%\USB\HPUSBFW.EXE"
FileDelete,"%TempFolder%\USB\hpusbfw_eula.rtf"
FileDelete,"%TempFolder%\USB\robocopy.exe"
#
Message,"All done!"

[USBError]
Message,"You must rebuild VistaPE with using #$qMultiBoot#$q or #$qStandard in RAM#$q build model!"
Halt,"You must rebuild VistaPE with using #$qMultiBoot#$q or #$qStandard in RAM#$q build model!"

[StandardBM]
If,"%pFileBox1%",Equal,"q:\",Set,"%BootDev%","q:"
If,"%pFileBox1%",Equal,"w:\",Set,"%BootDev%","w:"
If,"%pFileBox1%",Equal,"e:\",Set,"%BootDev%","e:"
If,"%pFileBox1%",Equal,"r:\",Set,"%BootDev%","r:"
If,"%pFileBox1%",Equal,"t:\",Set,"%BootDev%","t:"
If,"%pFileBox1%",Equal,"y:\",Set,"%BootDev%","y:"
If,"%pFileBox1%",Equal,"u:\",Set,"%BootDev%","u:"
If,"%pFileBox1%",Equal,"i:\",Set,"%BootDev%","i:"
If,"%pFileBox1%",Equal,"o:\",Set,"%BootDev%","o:"
If,"%pFileBox1%",Equal,"p:\",Set,"%BootDev%","p:"
If,"%pFileBox1%",Equal,"a:\",Set,"%BootDev%","a:"
If,"%pFileBox1%",Equal,"s:\",Set,"%BootDev%","s:"
If,"%pFileBox1%",Equal,"d:\",Set,"%BootDev%","d:"
If,"%pFileBox1%",Equal,"f:\",Set,"%BootDev%","f:"
If,"%pFileBox1%",Equal,"g:\",Set,"%BootDev%","g:"
If,"%pFileBox1%",Equal,"h:\",Set,"%BootDev%","h:"
If,"%pFileBox1%",Equal,"j:\",Set,"%BootDev%","j:"
If,"%pFileBox1%",Equal,"k:\",Set,"%BootDev%","k:"
If,"%pFileBox1%",Equal,"l:\",Set,"%BootDev%","l:"
If,"%pFileBox1%",Equal,"z:\",Set,"%BootDev%","z:"
If,"%pFileBox1%",Equal,"x:\",Set,"%BootDev%","x:"
If,"%pFileBox1%",Equal,"c:\",Set,"%BootDev%","c:"
If,"%pFileBox1%",Equal,"v:\",Set,"%BootDev%","v:"
If,"%pFileBox1%",Equal,"b:\",Set,"%BootDev%","b:"
If,"%pFileBox1%",Equal,"n:\",Set,"%BootDev%","n:"
If,"%pFileBox1%",Equal,"m:\",Set,"%BootDev%","m:"
ShellExecute,Open,"%TargetDir%\boot\bootsect.exe","/nt60 %BootDev% /force"

[Process]
ReadENV
If,"%BuildModel%",Equal,"MultiBoot",Run,%ScriptFile%,AutoBootMGR
If,"%BuildModel%",Equal,"RAM",Set,%BootSect%,"boot/etfsboot.com"
If,"%BuildModel%",Equal,"Normal",Set,%BootSect%,"boot/etfsboot.com"
If,NotExistFile,"%TargetDir%\vistape.wim",Set,%BootSect%,"boot/etfsboot.com"
Retrieve,FolderSize,%TargetDir%,%sizeFolder%
StrFormat,Bytes,%sizeFolder%
echo,"Creating ISO: [%isofile%] Folder size: %sizeFolder%"
If,"%BootSect%",Equal,"Boot/etfsboot.com",Run,%ScriptFile%,NormalCD
If,"%BootSect%",NotEqual,"Boot/etfsboot.com",Run,%ScriptFile%,CompatibleCD
#If,NotExistFile,"%TargetDir%\sources\boot.wim",Run,%ScriptFile%,NormalCD
#If,ExistFile,"%TargetDir%\sources\boot.wim",Run,%ScriptFile%,CompatibleCD
Retrieve,FileSize,%ISOfile%,%sizeISO%
#TODO error with very big iso
#If,%sizeISO%,Smaller,50000,Run,%ScriptFile%,TryNormalCD
#Retrieve,FileSize,%ISOfile%,%sizeISO%
StrFormat,Bytes,%sizeISO%
echo,"ISO build size is %sizeISO%"
If,%pCheckBox2%,Equal,True,Run,%ScriptFile%,BurnIso

[MakeDrvIndex]
Echo,"Making drivers index..."
ShellExecute,Hide,#$q%Tools%\drv_index.exe#$q,"#$q%TargetDir%\Drivers#$q"

[BurnIso]
Echo,"Burning ISO..."
ShellExecute,Open,#$q%Tools%\Iso-Burner.exe#$q,"-o #$q%IsoFile%#$q"

[TryNormalCD]
Set,%BootSect%,"boot/etfsboot.com"
Run,%ScriptFile%,NormalCD

[CheckCompat]
If,"%BuildModel%",NotEqual,"RAM",Message,"You can not use non standard boot manager with #$qNORMAL#$q build model. please use #$qIn RAM#$q build model or standard boot manager."
If,"%BuildModel%",NotEqual,"RAM",Halt,"You can not use non standard boot manager with #$qNORMAL#$q build model. please use #$qIn RAM#$q build model or standard boot manager."

[AutoBootMGR]
Set,%BootSect%,"boot/etfsboot.com"
If,ExistFile,"%targetdir%\boot\grldr",Set,%BootSect%,"boot/grldr"
If,ExistFile,"%targetdir%\bootsect.bin",Set,%BootSect%,"bootsect.bin"

[NormalCD]
If,%pCheckBox1%,NotEqual,true,ShellExecute,Hide,#$q%Tools%\mkisofs.exe#$q,"-iso-level 4#$s-force-uppercase -volid #$q%pTextBox1%#$q -b #$q%BootSect%#$q -no-emul-boot -boot-load-size 4 -hide boot.catalog#$s-duplicates-once -o #$q%IsoFile%#$q #$q%targetdir%#$q"
If,%pCheckBox1%,Equal,true,ShellExecute,Open,#$q%Tools%\mkisofs.exe#$q,"-iso-level 4#$s-force-uppercase -volid #$q%pTextBox1%#$q -b #$q%BootSect%#$q -no-emul-boot -boot-load-size 4 -hide boot.catalog#$s-duplicates-once -o #$q%IsoFile%#$q #$q%targetdir%#$q"

[CompatibleCD]
If,%pCheckBox1%,NotEqual,true,ShellExecute,Hide,#$q%Tools%\mkisofs.exe#$q,"-rdNlDTJ #$s-force-uppercase -duplicates-once -joliet-long -hide-joliet-trans-tbl -volid #$q%pTextBox1%#$q -eltorito-boot #$q%BootSect%#$q -no-emul-boot -boot-load-size 4 -boot-info-table -hide boot.catalog#$s-o #$q%IsoFile%#$q #$q%targetdir%#$q"
If,%pCheckBox1%,Equal,true,ShellExecute,Open,#$q%Tools%\mkisofs.exe#$q,"-rdNlDTJ #$s-force-uppercase -duplicates-once -joliet-long -hide-joliet-trans-tbl -volid #$q%pTextBox1%#$q -eltorito-boot #$q%BootSect%#$q -no-emul-boot -boot-load-size 4 -boot-info-table -hide boot.catalog#$s-o #$q%IsoFile%#$q #$q%targetdir%#$q"

[InterfaceEncoded]

[EncodedFile-AuthorEncoded-VistaPE-11-Small.gif]
lines=0
0=R0lGODlhWQAjANU/AOmRkPzwypG12Pj39PbVZuysq05YZvCbUcfa67HL4/jgkOuILKzKo0eKMuR7dmmayeZ0JId3SPKuE3GlYJKZq+6cF1xqh9xPSfSzjtk7NvPHM/rpr9OtKsrP15qyffLBtWE1UO2KFzh5uKePOPnl3i89YfKqf+m5IjtIYZsvPvXLyfbY1+Tn6u+gc/345Nbg7LK4xneDmvnZx0qGvuFmYeTt86KquuBeYZa9iyo8YdYyKdYoLB9psPLCIP///////yH5BAEAAD8ALAAAAABZACMAAAb/wJ9wSCwahz5fZ8lsspJQ33FKrVqHqmy2AOh6v13abfyx5HK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aA0Bhi807x7LSwhAIDR8PC4Ncz27xQUV/wDwU2mURcSCofkA8g6iEwkAiZPgexj61Z8cQ+ddQRzAx54fKmcDgLlwhA4+6vzjDz0LDCTTooHc19v8LRCYMUSvMEiJT9WI4VeRq0yHhePatClKt6QgQMfFOuDCjTr4KBF02jwqg8RR92LfbVJLXCuU7G9tWCI292ND4ZpQMBMTfvbLAICWDdD2GafLUSoPVRbIswMqLAa4m+L1UsAP0ujQL+0zqBIp5q3lI4HEjJgKrsiJGgh90I+BOBbD/YgADVkk/kaMYaxJ59EABsosEEAeSawLG71weFLEAA7eJwTCcssLkkMcNU1NNQNzk3MydFLz0xjGAUjBfCy4pePC/p4l5EBAFzPCVvZ0RNqAQAAAAIAAAAsAAAADQUAAAAAAAABAAAAAAAAAAAAAAA

[AuthorEncoded]
authorlogo.jpg=3193,4260
VistaPE-11-Small.gif=1Kb,1Kb
Logo=VistaPE-11-Small.gif

[EncodedFile-AuthorEncoded-authorlogo.jpg]
lines=1
[encoded data, 4262 characters]

[EncodedFolders]
USB

[EncodedFile-USB-robocopy.exe]
lines=10
[encoded data, 43943 characters]

[USB]
robocopy.exe=32Kb,42Kb
hpusbfw_eula.rtf=6Kb,8Kb
HPUSBFW.EXE=368Kb,491Kb
grubinst_gui.exe=24Kb,32Kb
grubinst.exe=23Kb,30Kb

[EncodedFile-USB-hpusbfw_eula.rtf]
lines=2
[encoded data, 8766 characters]

[EncodedFile-USB-HPUSBFW.EXE]
lines=122
[encoded data, 503080 characters]

[EncodedFile-USB-grubinst_gui.exe]
lines=8
[encoded data, 32916 characters]

[EncodedFile-USB-grubinst.exe]
lines=7
[encoded data, 31596 characters]

