[Main]
Title=Run ISO in VMware
Type=script
Level=8
Description=Runs your ISO in VMware player or workstation
Selected=False
Author=booty#1
Version=003
Date=2007-08-26
Download_Level=2
Mandatory=False

[Variables]
%VMXDir%=%TempFolder%\VMware
%VMXFile%=%VMXDir%\VistaPE.vmx

[Process]
RegRead,"HKLM","SOFTWARE\VMware, Inc.\VMware Workstation","InstallPath","%VMwarePath%"
#Message,"Detected VMware player or workstation installation under: _%VMwarePath%_",Information
If,ExistDir,%VMwarePath%,Run,%ScriptFile%,Installed
If,NotExistDir,%VMwarePath%,Run,%ScriptFile%,NotInstalled

[Installed]
If,NotExistDir,"%VMXDir%",DirMake,"%VMXDir%"
Run,%ScriptFile%,Clean
ExtractFile,"%ScriptFile%","Folder","VistaPE.vmx","%VMXDir%"
If,%pCheckBox5%,Equal,True,ExtractFile,"%ScriptFile%","Folder","nvram","%VMXDir%"
If,NotExistFile,"%VMXDir%\ide_disk_100gb.vmdk",ExtractFile,"%ScriptFile%","Folder","ide_disk_100gb.vmdk","%VMXDir%"
TXTReplace,"%VMXFile%","VistaPE","%ProjectName%"
TXTReplace,"%VMXFile%","$MEMORY$","%pNumberBox1%"
TXTReplace,"%VMXFile%","$ISOFILE$","%ISOfile%"
TXTReplace,"%VMXFile%","$HDD_ENABLED$","%pCheckBox1%"
TXTReplace,"%VMXFile%","$POWERON$","%pCheckBox3%"
TXTReplace,"%VMXFile%","$POWEROFF$","%pCheckBox4%"
If,%pScrollBox1%,NotEqual,"disabled",Run,%ScriptFile%,Ethernet
Run,%ScriptFile%,MaxResolution
echo,"Running %IsoFile% in VMware.."
ShellExecuteEx,Open,"%VMXFile%",""
#Wait,10

[Clean]
echo,"Cleaning directory #$q%VMXDir%#$q..."
If,ExistFile,"%VMXFile%",FileDelete,"%VMXFile%"
If,ExistFile,"%VMXDir%\*.log",FileDelete,"%VMXDir%\*.log"
If,ExistFile,"%VMXDir%\*.vmem",FileDelete,"%VMXDir%\*.vmem"
If,ExistFile,"%VMXDir%\*.vmss",FileDelete,"%VMXDir%\*.vmss"
If,ExistFile,"%VMXDir%\*.vmsd",FileDelete,"%VMXDir%\*.vmsd"
If,ExistFile,"%VMXDir%\*.vmxf",FileDelete,"%VMXDir%\*.vmxf"
If,ExistFile,"%VMXDir%\nvram",FileDelete,"%VMXDir%\nvram"
If,%pCheckBox2%,Equal,false,If,ExistFile,"%VMXDir%\*.vmdk",FileDelete,"%VMXDir%\*.vmdk"

[Ethernet]
TXTAddLine,"%VMXFile%","Ethernet0.present=#$qTRUE#$q","Append"
TXTAddLine,"%VMXFile%","Ethernet0.connectionType=#$q%pScrollBox1%#$q","Append"
TXTAddLine,"%VMXFile%","Ethernet0.addressType=#$qgenerated#$q","Append"
TXTAddLine,"%VMXFile%","Ethernet0.virtualDev=#$qe1000#$q","Append"

[MaxResolution]
If,%pScrollBox2%,NotEqual,"unlimited",begin
StrFormat,LEFT,%pScrollBox2%,4,%ResolutionWitdh%
StrFormat,RIGHT,%pScrollBox2%,4,%ResolutionHeight%
StrFormat,CTRIM,%ResolutionWitdh%,"x",%ResolutionWitdh%
StrFormat,CTRIM,%ResolutionHeight%,"x",%ResolutionHeight%
TXTAddLine,"%VMXFile%","svga.maxWidth=#$q%ResolutionWitdh%#$q","Append"
TXTAddLine,"%VMXFile%","svga.maxHeight=#$q%ResolutionHeight%#$q","Append"
end

[NotInstalled]
Beep,Error
Message,"VMWare Player or Workstation must be installed in order to run it!",Error

[Interface]
pTextLabel1=Requirements:,1,1,10,8,230,18,8,Normal
pTextLabel2="VMware Player 2.0 or VMware Workstation 6 or higher must be installed on your system!",1,1,10,26,349,34,9,Bold
pTextLabel3="Guest memory:",1,1,10,74,84,18,8,Normal
pTextLabel4=MB,1,1,175,74,24,18,8,Normal
pTextLabel5="Ethernet0 mode:",1,1,11,103,84,18,8,Normal
pTextLabel6="Maximum resolution:",1,1,11,134,113,18,8,Normal
pWebLabel1="Download VMware player",1,10,228,47,121,18,http://www.vmware.com/download/player/
pNumberBox1=pNumberBox1,1,2,124,72,45,22,768,400,1024,16
pScrollBox1=bridged,1,4,124,101,99,21,Disabled,nat,bridged,hostonly
pScrollBox2=1024x768,1,4,124,133,99,21,800x600,1024x768,1280x1024,1600x1200,unlimited
pCheckBox2="Do not reset disk image before run",1,3,17,180,200,18,False
pCheckBox1="Add empty 100GB disk image",1,3,17,200,200,18,True
pCheckBox3="Start booting when VM is launched",1,3,17,220,200,18,True
pCheckBox4="Close VM on power off",1,3,17,240,200,18,True
pCheckBox5="Use included BIOS settings (changes boot order)",1,3,17,260,274,18,True

[EncodedFolders]
Folder

[Folder]
ide_disk_100gb.vmdk=22Kb,30Kb
VistaPE.vmx=493,658
nvram=982,1310

[EncodedFile-Folder-ide_disk_100gb.vmdk]
lines=7
[encoded data, 31044 characters]

[EncodedFile-AuthorEncoded-vmware.bmp]
lines=0
0=eJzlmX1o1WUUx6cJkfVPVgb2j6VpgYGQmyUV+J5m4HwrzT9cTc230K2piYGlt9oyWLXJsIx0aa4XmEht86+sLTUpWlPM3ghFEzWKYEW+7Ol+nv3Or3OfPb/f7951g6DBl+3uPvf5fc95znPO95w77sGioQX2pyiN29IYGaBPweDuN4L3/w8/o++42fyXkC3v+q0vmMqVs01q8RSzfsEks/qRsVmD9UlgXx/cdXq/kgcKs7KjtnyGd79/wlnvx/olxWOyApx9iLKh+olpiT7prW8B3GdOHGXGjxqWiDEjh1iIz/mb/4tdrg34HfhsyBeKUrWm367jpt+2dnPlltacMGLBCjNm3D3WBvyk+RPvwj8fdlStKM4A+5WXP2r67j1j0ee9E9125ICBm97qtiF9Dm4c7Xh6Xg/+2g4B3PRrzS8Jy6o3mxvbjbn+4CVT0HrZ9P3oj6xQ0PKbtZkz6/9Ss+UMd30G8I+zIR/gjD/sNKb2p8tm1teXzLD2yxZ3ft5pf2PX1Qe7rG09kLaBMyCOfPx3pxYaIHb01hb5nN5HwP7f//iNaf6l06w+0WVtWPnDRWsP4O/Cji6/DYq/xI+Pv2DXhvmxtvj4CfiswN3X7r37NbO6pc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