; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/2000/XP ; Script ver: 0.94 BETA ; Date: May 10, 2004 ; Author: Greg Fuller (gfuller at oswego dot edu) ; Matt Tehonica (tehonica at oswego dot edu) ; ; Script Function: ; This script will check keys in the registry that are known to contain the uninstall ; strings for certain antivirus software. It will then attempt to silently uninstall any ; antivirus software packages found (and in the registry list) and then install McAfee v7 ; Home Edition. ; ; ; License: ; ; FREE! If you intend on using this script please fire us off an email. We're interested ; to know what the demand for a script like this is. ; ; Comments/Changes: ; ; If you have any comments or suggestions or changes you made to this script that you would ; like to share and contribute please email us as we will include the updates. It's always ; good to get feedback from others! ; ; ; Requirements: ; ; - wget.exe (download from http://www.gnu.org/software/wget/wget.html) ; - pkzip.exe (from the old pkz204g.exe from pkware...no longer available from them) ; - md5sum.exe (I got it from http://www.etree.org/md5com.html but is available in core GNU utils ; - mcafee7.exe (self extracting command line version with full mcafee install files placed in root of \McAfee) ; - 451.exe (self extracting command line version of mcafee 451 install files which expands .\451 directory) ; ; ; Usage: ; ; ; ; ; ; ; AutoItSetOption("TrayIconDebug", 1) ;0=no info, 1=debug line info AutoItSetOption("TrayIconHide", 1) ;0=dont hide tray icon, 1=hide tray icon $DriveLetter = GetDriveLetter() global $McAfee451BaseURL = " http://www.example.edu/" global $McAfee451File = "451.exe" global $McAfee451Loc = $McAfee451BaseURL & $McAfee451File global $McAfee451MD5 = "74647e4b722985ef3a0195fc90f9383d" global $McAfee7BaseURL = " http://www.example.edu/" global $McAfee7File = "mcafee7.exe" global $McAfee7Loc = $McAfee7BaseURL & $McAfee7File global $McAfee7MD5 = "dd6aebfafdfee2a27659b68fa65a5ddc" ; We have a local store of the mcafee defs on one of our local ftp servers, it's updated multiple times a day global $UpdateBaseURL = " ftp://ftp.oswego.edu/virusdefs/4.x/" global $UpdateFile = "update.ini" global $UpdateLoc = $UpdateBaseURL & $UpdateFile global $DownloadDir = "McAfee" global $DownloadPath = $DriveLetter & $DownloadDir & "\" global $WGet = "wget.exe " $WorkingDirectoryType = DriveGetType(@WorkingDir) ;MsgBox(4096, "", "Working Dir: " & @WorkingDir) SplashTextOn("SUNY Oswego McAfee Home Installation", "McAfee VirusScan v7 Home edition installation utility." & @CR & @CR & "This utility will uninstall any AntiVirus software that may be installed on your computer." & @CR & "After uninstallating the AntiVirus software, the SUNY Oswego licensed version of McAfee VirusScan v7 Home Edition will be installed." & @CR & "The lastest AntiVirus definitions and scan engine will also be installed." & @CR & @CR & @CR & "Written by Greg Fuller && Matt Tehonica. Version .92ß", "-1", "150", "-1", "-1", "0", "", "10") Sleep(10000) SplashOff() If MsgBox(20, "Warning!", "By continuing you understand that ANY AntiVirus software currently installed will be Uninstalled automatically."& @CR & @CR & "Do you understand and wish to continue?") == 7 then EndScript(0) EndIf ProgressOn("SUNY Oswego McAfee Home Installation", "Checking for AntiVirus Software.", "", @DesktopWidth - 325, @DesktopHeight - 175, 16) DirCreate($DownloadPath) If StringLower($WorkingDirectoryType) == "cdrom" then UpdateProgress("Copying Installation Files.", "3") If Not DirCopy(@WorkingDir, StringTrimRight($DownloadPath, 1), 1) then MsgBox(4096, "Error!", "Cannot copy files from " & @WorkingDir & " to " & $DownloadPath) EndScript(0) EndIf EndIf FileInstall("md5sum.exe", $DownloadPath) ; include the md5sum program and extract to DownloadPath FileInstall("wget.exe", $DownloadPath) ; include the wget.exe program and extract to DownloadPath FileChangeDir($DownloadPath) $OSVer = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProductName") If @error = 1 or @error = -1 then $OSVer = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName") ElseIf @error = 1 or @error = -1 then MsgBox(4096, "Cannot determine Windows version. Please call the HelpDesk at x3456.") EndScript(0) EndIf If $OSVer = "Microsoft Windows XP" or $OSVer = "Microsoft Windows 2000" then If IsAdmin() Then If DriveSpaceFree($DriveLetter) >= 75 then CheckForAntiVirus() InstallMcAfee7() Else MsgBox(4096, "Not Enough Free Space","You do not have enough free space on " & $DriveLetter & ". Please free 75M on this drive to Install McAfee AntiVirus v7.") EndScript(0) EndIf Else MsgBox(4096, "No Admin Rights", "You do not have Administrative rights in this account.\n\nAdministrator rights are required for installation!\n\nPlease log out and log in to an account with Administrator rights that will allow you to install programs.") EndScript(0) EndIf ElseIf $OSVer = "Microsoft Windows ME" or $OSVer = "Microsoft Windows 98" or $OSVer = "Microsoft Windows 95" then If DriveSpaceFree($DriveLetter) >= 75 then CheckForAntiVirus() InstallMcAfee451() Else MsgBox(4096, "Not Enough Free Space","You do not have enough free space on " & $DriveLetter & ". Please free 75M on this drive to Install McAfee AntiVirus v7.") EndScript(0) EndIf Else MsgBox(4096,"This version of McAfee AntiVirus is not compatible with your version of Windows. Please call the HelpDesk at x3456 for more information.") EndScript(0) EndIf #cs The CheckForAntiVirus() function checks the computer for the following antivirus programs: -McAfee 7.0.3 -McAfee 7.0.0 -McAfee 4.0.3 -McAfee 4.5.1 -AVG 6 -AVG 7 -Norton 2001 -Norton 2002 -Norton 2003 -Norton 2004 -Norton Corporate 8 It checks for these programs by checking the uninstall strings from the registry. This fuction will update the progress bar, grab the uninstall string from the registry and store it in $UninstallString, and then begin checking for that program. It does this before each If Statement. If it finds any of these antivirus programs installed, it will IMMEDIATELY call the uninstall function and then return to the spot it left off. Therefore, it will remove any and all antivirus software currently installed. It will also set a variable called $PreviousFound. This is a flag that represents whether it found previous antivirus software installed. This is needed so you can display a message box at the end of the fuction to tell the user whether you found previous antivirus software installed. #ce Func CheckForAntiVirus() ; To please users, this is our cheap way to increase the progress bar to make them feel special for $i = 1 to 20 $i = $i*2 ProgressSet($i, "Checking for AntiVirus Software.") sleep(1000) Next ;Determine which Virus Scan is already installed $PreviousFound = 0 ;Check for McAfee v7.0.3 UpdateProgress("Checking for McAfee v7.0.3.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E4DC62CE-5F95-11D6-B254-00C04FF4B435}", "UninstallString") If $UninstallString = "MsiExec.exe /X{E4DC62CE-5F95-11D6-B254-00C04FF4B435}" then $Version = "McAfee703" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for McAfee v7.0.0 UpdateProgress("Checking for McAfee v7.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E4DC62CE-5F95-11D6-B254-00C04FF4B435}", "UninstallString") If $UninstallString = "MsiExec.exe /I{E4DC62CE-5F95-11D6-B254-00C04FF4B435}" then $Version = "McAfee" UpdateProgress("Uninstalling " & $Version & " v7.0.0", "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for McAfee v4.03 UpdateProgress("Checking for McAfee v4.03.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\McAfee VirusScan", "UninstallString") If $UninstallString = "c:\progra~1\networ~1\mcafee~1\setup.exe -fc:\progra~1\networ~1\mcafee~1\uninst.ins" then $Version = "McAfee" UpdateProgress("Uninstalling " & $Version & " v.4.0.3", "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for McAfee 4.51 UpdateProgress("Checking for McAfee v4.51.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{87AEFD84-BC0D-11D4-B885-00508B022A51}", "UninstallString") If $UninstallString = "MsiExec.exe /I{87AEFD84-BC0D-11D4-B885-00508B022A51}" then $Version = "McAfee" UpdateProgress("Uninstalling " & $Version & " v4.5.1", "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for AVG 6 UpdateProgress("Checking for AVG v6.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AVG6INSTALL", "UninstallString") If $UninstallString = "C:\PROGRA~1\Grisoft\AVG6\setup.exe /UNINSTALL" then $Version = "AVG6" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for AVG 7 UpdateProgress("Checking for AVG v7.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AVG7Uninstall", "UninstallString") If $UninstallString = "C:\Program Files\Grisoft\AVG7\setup.exe /UNINSTALL" then $Version = "AVG7" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for Norton 2001 UpdateProgress("Checking for Norton2001.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Norton AntiVirus", "UninstallString") $Norton2001 = """C:\WINDOWS\NAVUSTUB.EXE"" C:\WINDOWS\IsUninst.exe -f""C:\Program Files\Norton AntiVirus\nav95.isu"" -c""C:\Program Files\Norton AntiVirus\NAVINS95.DLL""" If $UninstallString == $Norton2001 then $Version = "Norton2001" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for Norton 2002 PE UpdateProgress("Checking for Norton2002.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{68AE158E-38F9-4027-A757-A82B00E45D5C}", "UninstallString") If $UninstallString = "MsiExec.exe /I{68AE158E-38F9-4027-A757-A82B00E45D5C}" then $Version = "Norton2002" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for Norton 2002 UpdateProgress("Checking for Norton2002.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3075C5C3-0807-4924-AF8F-FF27052C12AE}", "UninstallString") If $UninstallString = "MsiExec.exe /I{3075C5C3-0807-4924-AF8F-FF27052C12AE}" then $Version = "Norton2002" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for Norton 2003 Personal UpdateProgress("Checking for Norton2003.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EDCD4CE3-DE92-49A9-87F9-FE09B2FBA16C}", "UninstallString") If $UninstallString = "MsiExec.exe /I{EDCD4CE3-DE92-49A9-87F9-FE09B2FBA16C}" then $Version = "Norton2003" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for Norton 2003 Professional UpdateProgress("Checking for Norton2003.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F4C9398F-B6C6-4A4B-8B6D-795CD86F915D}", "UninstallString") If $UninstallString = "MsiExec.exe /I{F4C9398F-B6C6-4A4B-8B6D-795CD86F915D}" then $Version = "Norton2003" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for Norton 2004 UpdateProgress("Checking for Norton2004.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SymSetup.{C6B28661-7910-442E-ADDD-72EAA8395380}", "UninstallString") $Norton2004 = "C:\Program Files\Common Files\Symantec Shared\SymSetup\{C6B28661-7910-442E-ADDD-72EAA8395380}.exe /X" If $UninstallString == $Norton2004 then $Version = "Norton2004" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf ;Check for Norton Corporate 8 UpdateProgress("Checking for Norton 8 CE.", "5") $UninstallString = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0EFC6259-3AD8-4CD2-BC57-D4937AF5CC0E}", "UninstallString") If $UninstallString == "MsiExec.exe /X{0EFC6259-3AD8-4CD2-BC57-D4937AF5CC0E}" then $Version = "Norton8Corp" UpdateProgress("Uninstalling " & $Version, "15") UninstallAntiVirus($UninstallString, $Version) $PreviousFound = 1 EndIf If $PreviousFound == "0" then UpdateProgress(" ", "15") MsgBox(4096, "Warning", "We did not find any AntiVirus software on your computer. If you know you have AntiVirus software currently installed, uninstall it now and then press OK to install McAfee AntiVirus 7.") EndIf Return EndFunc Func UninstallAntiVirus($UninstallString, $Version) ;Build complete uninstall string If $Version == "McAfee" then $UninstallString = StringReplace($UninstallString, "/I", "/x ", 1) & " /q REMOVE=ALL REBOOT=ReallySupress" RunWait($UninstallString); ElseIf $Version == "McAfee703" then $UninstallString = StringReplace($UninstallString, "/I", "/x ", 1) & " /q REMOVE=ALL REBOOT=ReallySupress" RunWait($UninstallString); ElseIf $Version == "AVG6" then RunWait($UninstallString) WinWaitActive("Uninstall") ControlClick("Uninstall", "&Yes", "Button1") WinWaitActive("Uninstall Finished") ControlCommand("Uninstall Finished","Restart the system now", "Button2", "Uncheck", "") ControlClick("Uninstall Finished", "O&K", "Button1") ElseIf $Version == "AVG7" then $UninstallString = StringReplace($UninstallString, "/I", "/x ", 1) & " /HIDE" RunWait($UninstallString) ElseIf $Version == "Norton2001" then $UninstallString = $UninstallString & "-y -a" RunWait($UninstallString) ElseIf $Version == "Norton2002" then $UninstallString = $UninstallString & " /qb REBOOT=ReallySuppress REMOVE=ALL" Run($UninstallString) WinWait("Norton AntiVirus 2002", "You must restart your system for the configuration changes made to Norton AntiVirus 2002 to take effect. Click Yes to restart now or No if you plan to manually restart later.") WinActivate("Norton AntiVirus 2002", "You must restart your system for the configuration changes made to Norton AntiVirus 2002 to take effect. Click Yes to restart now or No if you plan to manually restart later.") Send("n") ElseIf $Version == "Norton2003" then $UninstallString = $UninstallString & " /qb REBOOT=ReallySuppress REMOVE=ALL" Run($UninstallString) WinWait("Norton AntiVirus 2003 Professional Edition", "You must restart your system for the configuration changes made to Norton AntiVirus 2003 Professional Edition to take effect. Click Yes to restart now or No if you plan to manually restart later.") WinActivate("Norton AntiVirus 2003 Professional Edition", "You must restart your system for the configuration changes made to Norton AntiVirus 2003 Professional Edition to take effect. Click Yes to restart now or No if you plan to manually restart later.") Send("n") ElseIf $Version == "Norton2004" then Run($UninstallString) WinWait("Norton AntiVirus 2004 Professional Setup", "Completely removes Norton AntiVirus 2004 Professional from your system.") WinActivate("Norton AntiVirus 2004 Professional Setup", "Completely removes Norton AntiVirus 2004 Professional from your system.") Send("r") WinWait("Norton AntiVirus 2004 Professional Setup", "Uninstall Norton AntiVirus 2004 Professional") WinActivate("Norton AntiVirus 2004 Professional Setup", "Uninstall Norton AntiVirus 2004 Professional") Send("n") WinWait("Norton AntiVirus 2004 Professional Setup", "Norton AntiVirus 2004 Professional has been successfully removed.") WinActivate("Norton AntiVirus 2004 Professional Setup", "Norton AntiVirus 2004 Professional has been successfully removed.") Send("l") Send("{ENTER}") WinWaitClose("Norton AntiVirus 2004 Professional Setup") ElseIf $Version == "Norton8Corp" then RunWait("MsiExec.exe /q /X{0EFC6259-3AD8-4CD2-BC57-D4937AF5CC0E} REMOVE=ALL REBOOT=ReallySuppress") EndIf Return EndFunc Func InstallMcAfee7() ; Check to see if files exist locally first, then do updates UpdateProgress("Installing McAfee v7.0.3.", "20") If FileExists($DownloadPath & $McAfee7File) then UpdateProgress("Checking MD5 checksum.", "21") CheckMD5 ($McAfee7File, $McAfee7MD5) UpdateProgress("Extracting McAfee Installation Files.", "22") RunWait ($DownloadPath & $McAfee7File & " -d -o " & $DownloadPath, "", @SW_HIDE) UpdateProgress("Installing McAfee v7.", "23") Run ($DownloadPath & "setup.exe /s /v/qb") WinWait("McAfee VirusScan Home Edition", "Please wait while Windows configures McAfee VirusScan Home Edition") While WinExists("McAfee VirusScan Home Edition", "Please wait while Windows configures McAfee VirusScan Home Edition") If WinExists("Error", "Installation failed.") then Send("{ENTER}") EndIf WEnd UpdateMcAfee() ; Register McAfee for update purposes ; Pull the keys out of your registry on a machine that already has McAfee 7 Home installed on it from: ; HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\McAfee Shared Components\Updater\Settings, the "CustomerID" and "MachineID" fields RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\McAfee Shared Components\Updater\Settings", "CustomerID", "REG_SZ", "INSERT_YOUR_CUSTOMER_ID_HERE") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\McAfee Shared Components\Updater\Settings", "MachineID", "REG_SZ", "INSERT_YOUR_MACHINE_ID_HERE") EndScript(1) ; Download McAfee and run updates Else ; MsgBox (4096, "", $WGet & "-c -O" & $DownloadPath & $McAfee7File & " " & $McAfee7Loc) UpdateProgress("McAfee v7 Installation Files.", "21") RunWait ($WGet & "-c -O" & $DownloadPath & $McAfee7File & " " & $McAfee7Loc) UpdateProgress("Extracting McAfee Installation Files.", "22") RunWait ($DownloadPath & $McAfee7File & " -d -o " & $DownloadPath, "", @SW_HIDE) UpdateProgress("Installing McAfee v7.", "23") Run ($DownloadPath & "setup.exe /s /v/qb") WinWait("McAfee VirusScan Home Edition", "Please wait while Windows configures McAfee VirusScan Home Edition") While WinExists("McAfee VirusScan Home Edition", "Please wait while Windows configures McAfee VirusScan Home Edition") If WinExists("Error", "Installation failed.") then Send("{ENTER}") EndIf WEnd ; WinWaitClose("McAfee VirusScan Home Edition", "Please wait while Windows configures McAfee VirusScan Home Edition") ; RunWait ($WGet & "-c -O" & $DownloadPath & $McAfee7File & " " & $UpdateLoc) ; ProcessWaitClose ("wget.exe") UpdateMcAfee() ; Register McAfee for update purposes (run it again to make sure it is actually registered ; Pull the keys out of your registry on a machine that already has McAfee 7 Home installed on it from: ; HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\McAfee Shared Components\Updater\Settings, the "CustomerID" and "MachineID" fields RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\McAfee Shared Components\Updater\Settings", "CustomerID", "REG_SZ", "INSERT_YOUR_CUSTOMERID_HERE") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\McAfee Shared Components\Updater\Settings", "MachineID", "REG_SZ", "INSERT_YOUR_MACHINEID_HERE") EndScript(1) EndIf EndFunc Func InstallMcAfee451() UpdateProgress("Downloading Installation Files.", "21") RunWait ($WGet & "-c -O" & $DownloadPath & $McAfee451File & " " & $McAfee451Loc) UpdateProgress("Checking MD5 checksum.", "22") CheckMD5 ($McAfee451File, $McAfee451MD5) UpdateProgress("Extracting Files.", "23") RunWait (@ComSpec & " /c " & $McAfee451File & " -d -o ") UpdateProgress("Installing McAfee.", "24") Run ($DownloadPath & "\451\setup.exe /qb", "", @SW_HIDE) WinWait("VirusScan Setup") WinSetState("VirusScan Setup", "", @SW_MINIMIZE) WinWait("McAfee VirusScan") WinWaitClose("McAfee VirusScan") UpdateMcAfee() EndScript(1) EndFunc Func GetDriveLetter() ; This function pulls the Windows System Directory path and returns just the ; drive letter Windows is installed on $DriveLetter = StringSplit(@WindowsDir, "\") $DriveLetter = $DriveLetter[1] & "\" return $DriveLetter EndFunc Func UpdateMcAfee() If FileExists ($DownloadPath & $UpdateFile) then ; MsgBox(4096, "", "Working Dir: " & @WorkingDir) UpdateProgress("Updating McAfee Virus Definitions.", "40") ; $updatef = FileOpen ($DownloadPath & $UpdateFile, 0) ; If $updatef = -1 Then ; MsgBox (0, "Error", "Unable to open file.") ; EndScript(0) ; EndIf $datfile = IniRead($DownloadPath & $UpdateFile, "SuperDat-IA32", "FileName", "") ; MsgBox(4096,"", $line) If @error = -1 Then MsgBox (0, "Error", "Unable to open file.") EndScript(0) EndIf ; $datfile = StringSplit ($line, "=") ; Extract filename from update file UpdateProgress("Installing latest virus definitions.", "45") ; MsgBox(4096, "", "Working Dir: " & @WorkingDir) ; MsgBox(4096, "", "dat file 1: " & $datfile[1]) RunWait ($DownloadPath & $datfile & " /silent") ; FileClose ($updatef) Else UpdateProgress("Downloading McAfee Virus Definitions.", "40") RunWait ($WGet & "-c -O" & $DownloadPath & $UpdateFile & " " & $UpdateLoc) $updatef = FileOpen ($DownloadPath & $UpdateFile, 0) If $updatef = -1 Then MsgBox (0, "Error", "Unable to open file.") EndScript(0) EndIf $datfile = IniRead($DownloadPath & $UpdateFile, "SuperDat-IA32", "FileName", "") If @error = -1 Then EndScript(0) EndIf UpdateProgress("Installing latest virus definitions.", "45") RunWait($WGet & "-c -O" & $DownloadPath & $datfile & " " & $DownloadPath & $UpdateBaseURL & $datfile) RunWait ($DownloadPath & $datfile & " /silent") FileClose ($updatef) ; FileDelete($updatef) EndIf EndFunc Func CheckMD5($filename, $checksum) RunWait(@ComSpec & " /C " & "c:\McAfee\md5sum.exe " & $filename & " > sum.dat", "", @SW_HIDE) $sum = StringSplit (FileReadLine ("sum.dat"), " ") $sum = $sum[1] ; take first section of the array as the checksum If $sum == $checksum Then ;checksum passes Return "1" Else MsgBox(4096, "", "Checksum failed! Please delete all files in the " & $DownloadPath & "directory and redownload the install file again!") EndScript(0) EndIf EndFunc Func EndScript($Success) If $Success == "1" then ProgressSet(100 , "Done", "Complete") Sleep(5000) ProgressOff() MsgBox(4096, "Install Completed", "McAfee AntiVirus is now installed! Please save all open documents and click OK to restart.") Shutdown(6) Else Exit EndIf EndFunc Func UpdateProgress ($Message, $Percent) $Percent = $Percent * 2 ProgressSet ($Percent, $Message) EndFunc