;-----------------------------------------------------------------------------
; AutoIt Version: 3.1.1.100
; Author:Andrew Calcutt 	Last Edited:1/8/2006
; Script Function:	Runs Prepsys Actions based on INI file
;-----------------------------------------------------------------------------
AutoItSetOption("RunErrorsFatal", 0) ;Do not show errors if run error
#include <GUIConstants.au3>
#include <string.au3>
#include <PrepSys\PrepSysFunc.au3> ;My Defined Functions for PrepSys
; ----------------------------------------------------------------------------
Dim $settings = @HomeDrive & "\settings.ini"
;If user defined settings.ini is not on C:\ , use default in working dir
If FileExists($settings) = 0 Then
	FileCopy(@ScriptDir & "\settings.ini", $settings, 0)
	FileSetAttrib($settings, "-R")
EndIf
;if working dir is not set in ini, write working dir to ini
If IniRead($settings, "Script_Settings", "Working_Dir", "") = "" Then
	$workingdir = @ScriptDir
	If StringLen($workingdir) <> 3 Then
		$workingdir = $workingdir & "\"
	EndIf
	IniWrite($settings, "Script_Settings", "Working_Dir", $workingdir)
EndIf
;-----------------------------------------------------------------------------
;declair variables
Dim $workingdir = IniRead($settings, "Script_Settings", "Working_Dir", "")
Dim $logonuser1 = IniRead($settings, "Script_Settings", "Admin_Username", "")
Dim $logonpass1 = _StringEncrypt(0, IniRead($settings, "Script_Settings", "Admin_Password", ""), "Prepsys", 2)
Dim $logonuser2 = IniRead($settings, "Script_Settings", "Sysprep_Username", "")
Dim $logonpass2 = _StringEncrypt(0, IniRead($settings, "Script_Settings", "Sysprep_Password", ""), "Prepsys", 2)
Dim $officesuitskey = _StringEncrypt(0, IniRead($settings, "OFFICE", "SUITES", ""), "Prepsys", 2)
Dim $officeappskey = _StringEncrypt(0, IniRead($settings, "OFFICE", "APPLICATIONS", ""), "Prepsys", 2)
Dim $progressref = 0, $requestnetwork = 0

Dim $cdimgname = IniRead($settings, "Background", "CD_Image", "")
Dim $specifyimgname = IniRead($settings, "Background", "Specify_Image_Name", "")
Dim $specifyimgdir = IniRead($settings, "Background", "Specify_Image_DIR", "")

Dim $mcafee_exe = IniRead($settings, "Program_Use_Only", "mcafee_exe", $workingdir & "McAfee\AutoInstall_McAfee.exe")
Dim $mcafee_patch_exe = IniRead($settings, "Program_Use_Only", "mcafee_patch_exe", $workingdir & "McAfee\Patch\AutoInstall_McAfee_Patch.exe")
Dim $sophos_exe = IniRead($settings, "Program_Use_Only", "sophos_exe", $workingdir & "Sophos\AutoInstall_Sophos.exe")
Dim $vpn_exe = IniRead($settings, "Program_Use_Only", "vpn_exe", $workingdir & "VPN\AutoInstall_VPN.exe")
Dim $office_exe = IniRead($settings, "Program_Use_Only", "office_exe", $workingdir & "OFFICE\AutoInstall_Office.exe")
Dim $datatel_exe = IniRead($settings, "Program_Use_Only", "datatel_exe", $workingdir & "DATATEL\AutoInstall_Datatel.exe")
Dim $deepfreeze_exe = IniRead($settings, "Program_Use_Only", "deepfreeze_exe", $workingdir & "Deepfreeze\DFSeed.bat")
Dim $cleansms_exe = IniRead($settings, "Program_Use_Only", "cleansms_exe", $workingdir & "CleanSMS\AutoRun_cleansms.exe")

Dim $netuser = IniRead($settings, "Program_Use_Only", "NetAdmin", "")
Dim $netpass = _StringEncrypt(0, IniRead($settings, "Program_Use_Only", "NetPass", ""), "Prepsys", 2)
Dim $netdom = IniRead($settings, "Program_Use_Only", "NetDom", "")

Dim $shownetprompt = IniRead($settings, "Program_Use_Only", "ShowNetLoginPrompt", "1")
;-----------------------------------------------------------------------------
;Declair Buttons
Dim $remuser, $mcinstall, $spinstall, $vpninstall, $offinstall, $datatel, $deepfreeze, $startmenu, $vissettings, $folderoptions, $copyprofile, $waitupdate, $cleansms, $mcguid, $defragment, $deleteini, $runsysprep
Dim $AWWMAM, $FOSMIV, $FOSTIV, $SSUM, $SSUMP, $STSR, $SWCWD, $SOCB, $STB, $SEOSF, $SSLB, $UABIFEFT, $UCTIF, $UDSFILOTD, $UVSOWAB, $mydocs, $mycomp, $mynetplaces, $iexplorer, $cleandesk, $offtool
Dim $Classic_Menu, $DisplayAdminTools, $DisplayFavories, $DisplayLogOff, $DisplayRun, $EnableDRAGandDROP, $ExpandControlPanel, $ExpandMyDocuments, $ExpandMyPictures, $ExpandNetworkConnections, $ExpandPrinters, $ScrollPrograms, $UsePersonalizedMenus
Dim $ShowControlPanel, $ShowMyComputer, $ShowMyDocs, $ShowMyMusic, $ShowMyPics, $ShowNetConn, $ShowAdminTools, $ShowSetProgramAccessAndDefaults, $StartMenuFavorites, $EnableDragDrop, $ScrollPrograms2, $ShowHelp, $ShowPrinters, $ShowRun, $ShowSearch
Dim $SearchNetPrinters, $DisplayFileSizeInFolderTips, $SimpleViewInFolderListView, $DisplaySystemFolderContents, $FullPathAddress, $FullPathTitle
Dim $CacheThumbnails, $ShowHiddenFiles, $ShowFileExtensions, $ShowHiddenSysFiles, $LaunchWindowsInSeperateProcess, $RememberFolderSettings, $RestoreWindowsAtLogon, $ControlPanelInMyComputer, $ShowCompressedFilesInColor, $ShowDesktopFolderInfoPopop, $UseSimpleFileSharing
Dim $scplabel, $smclabel, $smdlabel, $smmlabel, $smplabel, $snclabel, $satlabel, $mcafee_exe2, $mcafee_patch_exe2, $sophos_exe2, $vpn_exe2, $office_exe2, $datatel_exe2, $deepfreeze_exe2, $cleansms_exe2
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------

GUICreate("PrepSys", 400, 360)  ; Create PrepSys Window

$tab = GUICtrlCreateTab(0, 0, 400, 320)
$tab1 = GUICtrlCreateTabItem("General");--->General Settings Tab
GUICtrlSetState(-1, $GUI_SHOW) ;Display General Tab First
;Start - Run Group
GUICtrlCreateGroup("Run", 5, 30, 160, 285)
_IniReadCheckbox_Ran ($settings, $remuser, "Remove Initial User", "Script_Settings", "Delete_Start_User", "Program_Use_Only", "Deleted_Start_User", 10, 45, 110, 15, 145)
_IniReadCheckbox_Ran ($settings, $mcinstall, "Install McAffe", "Script_Settings", "Install_McAfee", "Program_Use_Only", "Installed_McAfee", 10, 60, 110, 15, 145)
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion", "szProductVer") <> "" Then GUICtrlCreatePic($workingdir & "PrepSys\installed.bmp", 130, 60, 15, 15)
_IniReadCheckbox_Ran ($settings, $spinstall, "Install Sophos", "Script_Settings", "Install_Sophos", "Program_Use_Only", "Installed_Sophos", 10, 75, 110, 15, 145)
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Sophos\SweepNT", "Version") <> "" Then GUICtrlCreatePic($workingdir & "PrepSys\installed.bmp", 130, 75, 15, 15)
_IniReadCheckbox_Ran ($settings, $vpninstall, "Install VPN", "Script_Settings", "Install_VPN", "Program_Use_Only", "Installed_VPN", 10, 90, 110, 15, 145)
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Cisco Systems\VPN Client", "InstallPath") <> "" Then GUICtrlCreatePic($workingdir & "PrepSys\installed.bmp", 130, 90, 15, 15)
_IniReadCheckbox_Ran ($settings, $offinstall, "Install Office", "Script_Settings", "Install_Office", "Program_Use_Only", "Installed_Office", 10, 105, 110, 15, 145)
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot", "Path") <> "" Then GUICtrlCreatePic($workingdir & "PrepSys\installed.bmp", 130, 105, 15, 15)
_IniReadCheckbox_Ran ($settings, $datatel, "Install Datatel", "Script_Settings", "Install_Datatel", "Program_Use_Only", "Installed_Datatel", 10, 120, 110, 15, 145)
If FileExists("C:\DATATEL\") Then GUICtrlCreatePic($workingdir & "PrepSys\installed.bmp", 130, 120, 15, 15)
_IniReadCheckbox_Ran ($settings, $deepfreeze, "Install DeepFreeze", "Script_Settings", "Install_DeepFreeze", "Program_Use_Only", "Installed_DeepFreeze", 10, 135, 135, 15, 145)
_IniReadCheckbox_Ran ($settings, $startmenu, "Set Start Menu Settings", "Script_Settings", "Set_Start_Menu", "Program_Use_Only", "Set_Start_Menu", 10, 150, 135, 15, 145)
_IniReadCheckbox_Ran ($settings, $vissettings, "Set Visual Settings", "Script_Settings", "Set_Visual_Settings", "Program_Use_Only", "Set_Visual_Settings", 10, 165, 110, 15, 145)
_IniReadCheckbox_Ran ($settings, $folderoptions, "Set Folder Settings", "Script_Settings", "Set_Folder_Options", "Program_Use_Only", "Set_Folder_Options", 10, 180, 110, 15, 145)
_IniReadCheckbox_Ran ($settings, $copyprofile, "Copy Profile", "Script_Settings", "Copy_Profile", "Program_Use_Only", "Copy_Profile_Step3", 10, 195, 110, 15, 145)
_IniReadCheckbox_Ran ($settings, $waitupdate, "Wait to Update", "Script_Settings", "Wait_Updates", "Program_Use_Only", "Waited_For_Updates", 10, 210, 110, 15, 145)
_IniReadCheckbox_Ran ($settings, $cleansms, "Clean SMS", "Script_Settings", "Clean_SMS", "Program_Use_Only", "Cleaned_SMS", 10, 225, 110, 15, 145)
_IniReadCheckbox_Ran ($settings, $mcguid, "Remove McAffe GUID", "Script_Settings", "Remove_McAfee_GUID", "Program_Use_Only", "Removed_McAfee_GUID", 10, 240, 125, 15, 145)
_IniReadCheckbox_Ran ($settings, $defragment, "Defragment", "Script_Settings", "Defrag", "Program_Use_Only", "Defraged", 10, 255, 110, 15, 145)
_IniReadCheckbox ($settings, $deleteini, "Delete settings.ini", "Script_Settings", "Delete_INI", 10, 270, 130, 15)
_IniReadCheckbox ($settings, $runsysprep, "Run Sysprep", "Script_Settings", "Run_Sysprep", 10, 285, 130, 15)
;Office Settings GUI
GUICtrlCreateGroup("Office Settings", 170, 30, 225, 110)
$offlabel1 = GUICtrlCreateLabel("Office Suites Key", 175, 45, 160, 15)
$offskey = GUICtrlCreateInput($officesuitskey, 175, 60, 215, 20)
$offlabel2 = GUICtrlCreateLabel("Office Applications Key", 175, 80, 160, 15)
$offakey = GUICtrlCreateInput($officeappskey, 175, 95, 215, 20)
_IniReadCheckbox ($settings, $offtool, "Add Office Toolbar in Taskbar", "OFFICE", "Add_Office_Toolbar", 175, 120, 160, 15)
;Start - Logon Information Group
GUICtrlCreateGroup("Logon Information", 170, 140, 225, 175)
GUICtrlCreateLabel("Default Admin User", 175, 155, 120, 15)
$username = GUICtrlCreateInput($logonuser1, 175, 170, 215, 20)
GUICtrlCreateLabel("Default Admin Pass", 175, 190, 120, 15)
$password = GUICtrlCreateInput($logonpass1, 175, 205, 215, 20, $ES_PASSWORD)
$cplabel1 = GUICtrlCreateLabel("Copy Profile User", 175, 235, 120, 15)
$username2 = GUICtrlCreateInput($logonuser2, 175, 250, 215, 20)
$cplabel2 = GUICtrlCreateLabel("Copy Profile Pass (Strong)", 175, 270, 150, 15)
$password2 = GUICtrlCreateInput($logonpass2, 175, 285, 215, 20, $ES_PASSWORD)

$tab2 = GUICtrlCreateTabItem("Start Menu") ;--->Start Menu Settings Tab

_IniReadCheckbox ($settings, $Classic_Menu, "Use Classic Menu", "StartMenu", "Classic_Menu", 10, 35, 160, 15)
GUICtrlCreateGroup("Classic Menu Settings", 5, 60, 180, 255)
_IniReadCheckbox ($settings, $DisplayAdminTools, "Display Admin Tools", "Classic_Menu_Options", "DisplayAdminTools", 10, 75, 160, 15)
_IniReadCheckbox ($settings, $DisplayFavories, "Display Favories", "Classic_Menu_Options", "DisplayFavories", 10, 90, 160, 15)
_IniReadCheckbox ($settings, $DisplayLogOff, "Display LogOff", "Classic_Menu_Options", "DisplayLogOff", 10, 105, 160, 15)
_IniReadCheckbox ($settings, $DisplayRun, "Display Run", "Classic_Menu_Options", "DisplayRun", 10, 120, 160, 15)
_IniReadCheckbox ($settings, $EnableDRAGandDROP, "Enable DRAG and DROP", "Classic_Menu_Options", "EnableDRAGandDROP", 10, 135, 160, 15)
_IniReadCheckbox ($settings, $ExpandControlPanel, "Expand Control Panel", "Classic_Menu_Options", "ExpandControlPanel", 10, 150, 160, 15)
_IniReadCheckbox ($settings, $ExpandMyDocuments, "Expand My Documents", "Classic_Menu_Options", "ExpandMyDocuments", 10, 165, 160, 15)
_IniReadCheckbox ($settings, $ExpandMyPictures, "Expand My Pictures", "Classic_Menu_Options", "ExpandMyPictures", 10, 180, 160, 15)
_IniReadCheckbox ($settings, $ExpandNetworkConnections, "Expand Network Connections", "Classic_Menu_Options", "ExpandNetworkConnections", 10, 195, 160, 15)
_IniReadCheckbox ($settings, $ExpandPrinters, "Expand Printers", "Classic_Menu_Options", "ExpandPrinters", 10, 210, 160, 15)
_IniReadCheckbox ($settings, $ScrollPrograms, "Scroll Programs", "Classic_Menu_Options", "ScrollPrograms", 10, 225, 160, 15)
_IniReadCheckbox ($settings, $UsePersonalizedMenus, "Use Personalized Menus", "Classic_Menu_Options", "UsePersonalizedMenus", 10, 240, 160, 15)
GUICtrlCreateGroup("Start Menu Settings", 190, 30, 205, 285)
_LabeledCombo ($settings, $ShowControlPanel, $scplabel, "Control Panel", "StartMenu", "ShowControlPanel", "Disabled", "Link", "Menu", 275, 45, 115, 20, 195, 35, 80, 15)
_LabeledCombo ($settings, $ShowMyComputer, $smclabel, "My Computer", "StartMenu", "ShowMyComputer", "Disabled", "Link", "Menu", 275, 65, 115, 20, 195, 55, 80, 15)
_LabeledCombo ($settings, $ShowMyDocs, $smdlabel, "My Documents", "StartMenu", "ShowMyDocs", "Disabled", "Link", "Menu", 275, 85, 115, 20, 195, 75, 80, 15)
_LabeledCombo ($settings, $ShowMyMusic, $smmlabel, "My Music", "StartMenu", "ShowMyMusic", "Disabled", "Link", "Menu", 275, 105, 115, 20, 195, 95, 80, 15)
_LabeledCombo ($settings, $ShowMyPics, $smplabel, "My Pictures", "StartMenu", "ShowMyPics", "Disabled", "Link", "Menu", 275, 125, 115, 20, 195, 115, 80, 15)
_LabeledCombo ($settings, $ShowNetConn, $snclabel, "Network", "StartMenu", "ShowNetConn", "Disabled", "Net Connections", "Connect to", 275, 145, 115, 20, 195, 135, 80, 15)
_LabeledCombo ($settings, $ShowAdminTools, $satlabel, "Admin Tools", "StartMenu", "ShowAdminTools", "Disabled", "Programs", "Start menu + progs", 275, 165, 115, 20, 195, 135, 80, 15)
_IniReadCheckbox ($settings, $ShowSetProgramAccessAndDefaults, "Program Access And Defaults", "StartMenu", "ShowSetProgramAccessAndDefaults", 195, 190, 160, 15)
_IniReadCheckbox ($settings, $StartMenuFavorites, "Start Menu Favorites", "StartMenu", "StartMenuFavorites", 195, 205, 160, 15)
_IniReadCheckbox ($settings, $EnableDragDrop, "Enable Drag Drop", "StartMenu", "EnableDragDrop", 195, 220, 160, 15)
_IniReadCheckbox ($settings, $ScrollPrograms2, "Scroll Programs", "StartMenu", "ScrollPrograms", 195, 235, 160, 15)
_IniReadCheckbox ($settings, $ShowHelp, "Show Help", "StartMenu", "ShowHelp", 195, 250, 160, 15)
_IniReadCheckbox ($settings, $ShowPrinters, "Show Printers", "StartMenu", "ShowPrinters", 195, 265, 160, 15)
_IniReadCheckbox ($settings, $ShowRun, "Show Run", "StartMenu", "ShowRun", 195, 280, 160, 15)
_IniReadCheckbox ($settings, $ShowSearch, "Show Search", "StartMenu", "ShowSearch", 195, 295, 160, 15)

$tab3 = GUICtrlCreateTabItem("Visual");--->Visual Settings Tab

GUICtrlCreateGroup("Visual Settings", 5, 30, 245, 285)
_IniReadCheckbox ($settings, $AWWMAM, "Animate windows when min & maxing", "Visual_Effects", "AWWMAM", 10, 45, 220, 15)
_IniReadCheckbox ($settings, $FOSMIV, "Fade or slide menus into view", "Visual_Effects", "FOSMIV", 10, 60, 220, 15)
_IniReadCheckbox ($settings, $FOSTIV, "Fade or slide tooltips into view", "Visual_Effects", "FOSTIV", 10, 75, 220, 15)
_IniReadCheckbox ($settings, $SSUM, "Show shadows under menu", "Visual_Effects", "SSUM", 10, 90, 220, 15)
_IniReadCheckbox ($settings, $SSUMP, "Show shadows under mouse pointer", "Visual_Effects", "SSUMP", 10, 105, 220, 15)
_IniReadCheckbox ($settings, $STSR, "Show translucent selection rectangle", "Visual_Effects", "STSR", 10, 120, 220, 15)
_IniReadCheckbox ($settings, $SWCWD, "Show window contents while dragging", "Visual_Effects", "SWCWD", 10, 135, 220, 15)
_IniReadCheckbox ($settings, $SOCB, "Slide open combo boxes", "Visual_Effects", "SOCB", 10, 150, 220, 15)
_IniReadCheckbox ($settings, $STB, "Slide taskbar buttons", "Visual_Effects", "STB", 10, 165, 220, 15)
_IniReadCheckbox ($settings, $SEOSF, "Smooth edges of screen fonts", "Visual_Effects", "SEOSF", 10, 180, 220, 15)
_IniReadCheckbox ($settings, $SSLB, "Smoth-scroll list boxes", "Visual_Effects", "SSLB", 10, 195, 220, 15)
_IniReadCheckbox ($settings, $UABIFEFT, "Use a background image for each folder type", "Visual_Effects", "UABIFEFT", 10, 210, 235, 15)
_IniReadCheckbox ($settings, $UCTIF, "Use common task in folders", "Visual_Effects", "UCTIF", 10, 225, 220, 15)
_IniReadCheckbox ($settings, $UDSFILOTD, "Use drop shadows for icon lables on desktop", "Visual_Effects", "UDSFILOTD", 10, 240, 230, 15)
_IniReadCheckbox ($settings, $UVSOWAB, "Use visual styles on windows and buttons", "Visual_Effects", "UVSOWAB", 10, 255, 220, 15)
;Desktop Settings GUI
GUICtrlCreateGroup("Desktop Image", 255, 30, 140, 155)
$imglab1 = GUICtrlCreateLabel("CD IMG Filename", 260, 45, 105, 15)
$cdimgname = GUICtrlCreateInput($cdimgname, 260, 60, 130, 20)
$imglab2 = GUICtrlCreateLabel("Local IMG Filename", 260, 95, 115, 15)
$imgname = GUICtrlCreateInput($specifyimgname, 260, 110, 130, 20)
$imglab3 = GUICtrlCreateLabel('Local IMG Directory', 260, 130, 215, 15)
$imglab4 = GUICtrlCreateLabel('(no trailing "\")', 260, 145, 215, 15)
$imgdir = GUICtrlCreateInput($specifyimgdir, 260, 160, 130, 20)
GUICtrlCreateGroup("Desktop Icons", 255, 185, 140, 130)
_IniReadCheckbox ($settings, $mydocs, "My Doucuments", "Desktop_Items", "My_Documents", 260, 200, 95, 15)
_IniReadCheckbox ($settings, $mycomp, "My Computer", "Desktop_Items", "My_Computer", 260, 215, 95, 15)
_IniReadCheckbox ($settings, $mynetplaces, "My Network Places", "Desktop_Items", "My_Network_Places", 260, 230, 110, 15)
_IniReadCheckbox ($settings, $iexplorer, "Internet Explorer", "Desktop_Items", "My_Network_Places", 260, 245, 110, 15)
_IniReadCheckbox ($settings, $cleandesk, "Cleanup desktop", "Desktop_Items", "Enable_Desktop_Cleanup", 260, 260, 110, 15)

$tab4 = GUICtrlCreateTabItem("Folder");--->Folder Settings Tab

;FOLDER OPTIONS GUI
GUICtrlCreateGroup("Folder Options", 5, 30, 180, 285)
_IniReadCheckbox ($settings, $SearchNetPrinters, "Auto Search Network Printers", "Folder_Options", "SearchNetPrinters", 10, 45, 170, 15)
_IniReadCheckbox ($settings, $DisplayFileSizeInFolderTips, "Display File Size In FolderTips", "Folder_Options", "DisplayFileSizeInFolderTips", 10, 60, 170, 15)
_IniReadCheckbox ($settings, $SimpleViewInFolderListView, "Simple View In Folder List View", "Folder_Options", "SimpleViewInFolderListView", 10, 75, 170, 15)
_IniReadCheckbox ($settings, $DisplaySystemFolderContents, "Display System Folder Contents", "Folder_Options", "DisplaySystemFolderContents", 10, 90, 160, 15)
_IniReadCheckbox ($settings, $FullPathAddress, "Full Path in Address Bar", "Folder_Options", "SearchNetPrinters", 10, 105, 160, 15)
_IniReadCheckbox ($settings, $FullPathTitle, "Full Path in Title", "Folder_Options", "FullPathTitle", 10, 120, 160, 15)
_IniReadCheckbox ($settings, $CacheThumbnails, "Cache Thumbnails", "Folder_Options", "CacheThumbnails", 10, 135, 160, 15)
_IniReadCheckbox ($settings, $ShowHiddenFiles, "Show Hidden Files", "Folder_Options", "ShowHiddenFiles", 10, 150, 160, 15)
_IniReadCheckbox ($settings, $ShowFileExtensions, "Show File Extensions", "Folder_Options", "ShowFileExtensions", 10, 165, 160, 15)
_IniReadCheckbox ($settings, $ShowHiddenSysFiles, "Show Hidden Sys Files", "Folder_Options", "ShowHiddenSysFiles", 10, 180, 160, 15)
_IniReadCheckbox ($settings, $LaunchWindowsInSeperateProcess, "Launch Windows In Seperate Process", "Folder_Options", "LaunchWindowsInSeperateProcess", 10, 195, 160, 15)
_IniReadCheckbox ($settings, $RememberFolderSettings, "Remember Folder Settings", "Folder_Options", "RememberFolderSettings", 10, 210, 160, 15)
_IniReadCheckbox ($settings, $RestoreWindowsAtLogon, "Restore Windows At Logon", "Folder_Options", "RestoreWindowsAtLogon", 10, 225, 160, 15)
_IniReadCheckbox ($settings, $ControlPanelInMyComputer, "Control Panel In My Computer", "Folder_Options", "ControlPanelInMyComputer", 10, 240, 160, 15)
_IniReadCheckbox ($settings, $ShowCompressedFilesInColor, "Show Compressed Files In Color", "Folder_Options", "ShowCompressedFilesInColor", 10, 255, 160, 15)
_IniReadCheckbox ($settings, $ShowDesktopFolderInfoPopop, "Show Desktop Folder Info Popop", "Folder_Options", "ShowDesktopFolderInfoPopop", 10, 270, 160, 15)
_IniReadCheckbox ($settings, $UseSimpleFileSharing, "Use Simple File Sharing", "Folder_Options", "UseSimpleFileSharing", 10, 285, 160, 15)

$tab4 = GUICtrlCreateTabItem("Program") ;--->Program Locations Tab

Dim $browse1, $browse2, $browse3, $browse4, $browse5, $browse6, $browse7, $browse8
GUICtrlCreateLabel("McAffee Auto Install Exe Location", 10, 30, 325, 15)
_FileBrowse ($mcafee_exe, $mcafee_exe2, $browse1, 10, 45, 325, 20, 345, 30)
GUICtrlCreateLabel("McAffee Patch Auto Install Exe Location", 10, 65, 325, 15)
_FileBrowse ($mcafee_patch_exe, $mcafee_patch_exe2, $browse2, 10, 80, 325, 20, 345, 30)
GUICtrlCreateLabel("Sophos Auto Install Exe Location", 10, 100, 325, 15)
_FileBrowse ($sophos_exe, $sophos_exe2, $browse3, 10, 115, 325, 20, 345, 30)
GUICtrlCreateLabel("VPN Auto Install Exe Location", 10, 135, 325, 15)
_FileBrowse ($vpn_exe, $vpn_exe2, $browse4, 10, 150, 325, 20, 345, 30)
GUICtrlCreateLabel("Office Auto Install Exe Location", 10, 170, 325, 15)
_FileBrowse ($office_exe, $office_exe2, $browse5, 10, 185, 325, 20, 345, 30)
GUICtrlCreateLabel("Datatel Auto Install Exe Location", 10, 205, 325, 15)
_FileBrowse ($datatel_exe, $datatel_exe2, $browse6, 10, 220, 325, 20, 345, 30)
GUICtrlCreateLabel("DeepFreeze Auto Install Exe Location", 10, 240, 325, 15)
_FileBrowse ($deepfreeze_exe, $deepfreeze_exe2, $browse7, 10, 255, 325, 20, 345, 30)
GUICtrlCreateLabel("CleanSMS Auto Run Exe Location", 10, 275, 325, 15)
_FileBrowse ($cleansms_exe, $cleansms_exe2, $browse8, 10, 290, 325, 20, 345, 30)

GUICtrlCreateTabItem("")   ; end tabitem definition

;BOTTOM BUTTONS
$setinirun = GUICtrlCreateButton("Set INI " & Chr(43) & " &Run", 10, 325, 80, 20)
$setini = GUICtrlCreateButton("&Set INI", 110, 325, 80, 20)
$removeini = GUICtrlCreateButton("&Delete INI", 210, 325, 80, 20)
$canclebutton = GUICtrlCreateButton("E&xit", 310, 325, 80, 20)

$programby = GUICtrlCreateLabel("Program By: Andrew Calcutt", 135, 345, 135, 15)
GUICtrlSetState($programby, $GUI_DISABLE)
GUISetState()

;Set States of controls
_StartMenuSwitch ()
_StartMenuState ()
_VisSettings_State ()
_Office_State ()
_Sophos_State ()
_McAfee_State ()
_Sysprep_User_State ()
_Folder_Options_State ()

GUISetState(@SW_SHOW)
While 1
	$msg = GUIGetMsg()
	Select
		Case $msg = $Classic_Menu
			_StartMenuSwitch ()
		Case $msg = $browse1 Or $msg = $browse2 Or $msg = $browse3 Or $msg = $browse4 Or $msg = $browse5 Or $msg = $browse6 Or $msg = $browse7 Or $msg = $browse8
			If $msg = $browse1 Then _FileBrowseSet ($mcafee_exe2, "McAfee Exe")
			If $msg = $browse2 Then _FileBrowseSet ($mcafee_patch_exe2, "McAfee Patch Exe")
			If $msg = $browse3 Then _FileBrowseSet ($sophos_exe2, "Sophos Exe")
			If $msg = $browse4 Then _FileBrowseSet ($vpn_exe2, "VPN Exe")
			If $msg = $browse5 Then _FileBrowseSet ($office_exe2, "Office Exe")
			If $msg = $browse6 Then _FileBrowseSet ($datatel_exe2, "Datatel Exe")
			If $msg = $browse7 Then _FileBrowseSet ($deepfreeze_exe2, "DeepFreeze Exe")
			If $msg = $browse8 Then _FileBrowseSet ($cleansms_exe2, "CleanSMS Exe")
		Case $msg = $spinstall
			_McAfee_State ()
		Case $msg = $mcinstall
			_Sophos_State ()
		Case $msg = $offinstall
			_Office_State ()
		Case $msg = $startmenu
			_StartMenuState ()
			If GUICtrlRead($startmenu) = 1 Then _StartMenuSwitch ()
		Case $msg = $vissettings
			_VisSettings_State ()
		Case $msg = $folderoptions
			_Folder_Options_State ()
		Case $msg = $copyprofile
			_Sysprep_User_State ()
		Case $msg = $removeini
			FileDelete($settings)
			ExitLoop
		Case $msg = $setini
			_Set_INI_Settings ()
			IniWrite($settings, "Script_Settings", "Working_Dir", "")
			ExitLoop
		Case $msg = $setinirun
			_Set_INI_Settings ()
			Run("PrepSys\_no_gui.exe")
			Exit
		Case $msg = $GUI_EVENT_CLOSE
			ExitLoop
		Case $msg = $canclebutton
			ExitLoop
	EndSelect
WEnd
GUIDelete()
