[Main]
Title=Basic configuration and tools
Type=script
Level=1
Description=Configuring shell, startup and more...
Selected=True
Author=NightMan
Version=12
Contact=vistape@vistape.net
Date=12.10.2008
Locked=false
Download_Level=0
Mandatory=True

[ExtractSystem32]
DirMake,"%TempFolder%\system32"
ExtractAllFiles,"%ScriptFile%","system32","%TempFolder%\system32"
ShellExecute,Hide,#$q%Tools%\7z.exe#$q,"x -y #$q%TempFolder%\system32\system32.7z#$q -o#$q%TempFolder%\system32#$q"
FileDelete,"%TempFolder%\system32\system32.7z"
If,NotExistFile,"%TempFolder%\system32\vpeldr.exe",Message,"Error extracting system files! Please send full log file to vistape@vistape.net"
If,NotExistFile,"%TempFolder%\system32\vpeldr.exe",Halt,"Error extracting system files! Please send full log file to vistape@vistape.net"

[CreateVPECFG]
FileCreateBlank,#1
IniAddSection,#1,"main"
IniAddSection,#1,"shortcut"
IniAddSection,#1,"autorun"
IniAddSection,#1,"registry"
IniAddSection,#1,"association"
IniAddSection,#1,"shells"
IniAddSection,#1,"postconfig"
IniWrite,#1,"main","screen","%ScreenResolution%"

[Process]
Echo,"Configuring shell..."
ReadENV
If,NotExistFile,"%TargetDir%\windows\system32\winpeshl.ini",FileCreateBlank,"%TargetDir%\windows\system32\winpeshl.ini"
If,NotExistFile,"%VPECFG%",Run,%ScriptFile%,CreateVPECFG,"%VPECFG%"
If,NotExistFile,"%VPECFGCD%",Run,%ScriptFile%,CreateVPECFG,"%VPECFGCD%"
#
IniWrite,"%VPECFG%","main","defaultshell","%Shell%"
#
TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","[LaunchApps]","Append"
TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","vpeldr.exe","Append"
#shell
If,"%Shell%",Equal,"Explorer",TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","explorer.exe","Append"
If,"%Shell%",Equal,"BS Explorer",TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","#$qx:\Program#$sFiles\BSExplorer\Explorer.exe#$q","Append"
If,"%Shell%",Equal,"Total Commander",TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","#$qX:\Program#$sFiles\totalcmd\TOTALCMD.EXE#$q","Append"
If,"%Shell%",Equal,"CMD",TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","cmd.exe#$c /k","Append"
#if shell error
TXTAddLine,"%TargetDir%\windows\system32\winpeshl.ini","cmd.exe#$c /k","Append"
Echo,"Copying system files..."
If,NotExistDir,"%TempFolder%\system32",Run,%ScriptFile%,ExtractSystem32
DirCopy,"%TempFolder%\system32\*.*","%TargetDir%\Windows\System32"
#
Echo,"Writing configuration...."
RegHiveLoad,Tmp_setupreg_hiv,%RegSystem%
RegWrite,"HKLM",0x4,"Tmp_setupreg_hiv\ControlSet001\Services\i8042prt\Parameters","EnableWheelDetection","2"
RegWrite,"HKLM",0x4,"Tmp_setupreg_hiv\ControlSet001\Services\FBWF","WinPECacheThreshold","%pScrollBox1%"
#add 14.12.2007 by powaking for support old samba servers
RegWrite,"HKLM",0x4,"Tmp_setupreg_hiv\ControlSet001\Control\Lsa","LmCompatibilityLevel","2"
#disable firewall 09.12.2007
RegWrite,"HKLM",0x4,"Tmp_setupreg_hiv\ControlSet001\Services\MpsSvc","Start","4"
#CPU priority, max 26, defaul 2 (2008.06.06 not recomended for use)
#RegWrite,"HKLM",0x4,"Tmp_setupreg_hiv\ControlSet001\Control\PriorityControl","Win32PrioritySeparation","6"
RegHiveUnLoad,Tmp_setupreg_hiv
RegHiveLoad,Tmp_default,%RegUser%
RegWrite,HKLM,0x4,"Tmp_default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced","Hidden","1"
RegWrite,HKLM,0x4,"Tmp_default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced","HideFileExt","0"
RegWrite,HKLM,0x4,"Tmp_default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced","ShowSuperHidden","1"
RegWrite,HKLM,0x4,"Tmp_default\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced","SuperHidden","1"
#
#install inf files
RegWrite,HKLM,0x2,"Tmp_default\Classes\inffile\shell\Install\command","","%SystemRoot%\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %1"
#
RegHiveUnLoad,Tmp_default
#
RegHiveLoad,Tmp_software,%RegSoftware%
#add command prompt to right click context menu
RegWrite,"HKLM",0x1,"Tmp_software\Classes\Drive\shell\Command Prompt Here\command","","cmd.exe /s /k pushd ""%V"""
RegWrite,"HKLM",0x1,"Tmp_software\Classes\Directory\shell\Command Prompt Here\command","","cmd.exe /s /k pushd ""%V"""
#add open with notepad to right context
RegWrite,"HKLM",0x1,"Tmp_software\Classes\*\shell\Open with Notepad\command","","notepad.exe ""%1"""
#Disable Webservices for unknown file types
RegWrite,"HKLM",0x4,"Tmp_software\Microsoft\Windows\CurrentVersion\Policies\Explorer","NoInternetOpenWith","1"
RegHiveUnLoad,Tmp_software
DirDelete,"%TempFolder%\system32"
RunFromRam,True
#
Add_Shortcut,StartMenu,"System","#$pSystemRoot#$p\system32\DevMan.exe","Device Manager"
#
If,ExistFile,"%Tools%\devcon.exe",Retrieve,FileSize,"%Tools%\devcon.exe",%devconsize%
If,ExistFile,"%Tools%\devcon.exe",If,%devconsize%,NotEqual,55808,FileDelete,"%Tools%\devcon.exe"
If,NotExistFile,"%Tools%\devcon.exe",Run,%ScriptFile%,DevCon_download
FileCopy,"%Tools%\devcon.exe","%TargetDir%\Windows\System32"
#
#postconfig
AddPostConfig,"DNS Client","x:\windows\system32\net.exe","start #$qDnscache#$q",3
AddPostConfig,"Server","x:\windows\system32\net.exe","start #$qLanmanServer#$q",3
AddPostConfig,"User Profile Service","x:\windows\system32\net.exe","start #$qProfSvc#$q",3
AddPostConfig,"Computer Browser","x:\windows\system32\net.exe","start #$qBrowser#$q",3
AddPostConfig,"Human Interface Device Access","x:\windows\system32\net.exe","start #$qhidserv#$q",3
#AddPostConfig,"Microsoft Software Shadow Copy Provider","x:\windows\system32\net.exe","start #$qswprv#$q",3
#AddPostConfig,"","x:\windows\system32\net.exe","start #$q#$q",3
#
#final check
Echo,"Final check..."
If,NotExistFile,"%TargetDir%\windows\system32\vpeldr.exe",Message,"Unexpected error! Please send full log file to vistape@vistape.net"
If,NotExistFile,"%TargetDir%\windows\system32\vpeldr.exe",Halt,"Unexpected error! Please send full log file to vistape@vistape.net"

[DevCon_download]
Echo,"Downloadind devcon..."
WebGet,"http://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe","%basedir%\Temp\devcon.exe"
ShellExecute,Hide,#$q%Tools%\7z.exe#$q,"x -y #$q%basedir%\Temp\devcon.exe#$q -o#$q%basedir%\Temp#$q"
FileCopy,"%basedir%\Temp\i386\devcon.exe","%Tools%\devcon.exe"
FileDelete,"%basedir%\Temp\EULA.txt"
DirDelete,"%basedir%\Temp\i386"
DirDelete,"%basedir%\Temp\ia64"
FileDelete,"%basedir%\Temp\devcon.exe"

[Interface]
pScrollBox1=64,1,4,126,16,150,21,32,64,96,128,256
pTextLabel1="FBWF cache size",1,1,10,20,89,18,8,Normal

[EncodedFolders]
system32

[system32]
system32.7z=751711,1002282

[InterfaceEncoded]

[AuthorEncoded]
VistaPE-11-Small.gif=1Kb,1Kb
Logo=VistaPE-11-Small.gif

[EncodedFile-AuthorEncoded-VistaPE-11-Small.gif]
lines=0
0=R0lGODlhWQAjANU/AOmRkPzwypG12Pj39PbVZuysq05YZvCbUcfa67HL4/jgkOuILKzKo0eKMuR7dmmayeZ0JId3SPKuE3GlYJKZq+6cF1xqh9xPSfSzjtk7NvPHM/rpr9OtKsrP15qyffLBtWE1UO2KFzh5uKePOPnl3i89YfKqf+m5IjtIYZsvPvXLyfbY1+Tn6u+gc/345Nbg7LK4xneDmvnZx0qGvuFmYeTt86KquuBeYZa9iyo8YdYyKdYoLB9psPLCIP///////yH5BAEAAD8ALAAAAABZACMAAAb/wJ9wSCwahz5fZ8lsspJQ33FKrVqHqmy2AOh6v13abfyx5HKlHCpm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