Sign in to follow this  
Followers 0
corvias

Definition Updater

4 posts in this topic

Hi Everyone! I think this might be my first post. Mainly because I've felt like too much of a noob to say anything useful, but I have lurked here awhile. Anyway, this is my first real script that does something useful. I run it at the beginning of each work day to get all the latest Defs for tools I use on a regular basis for cleaning Spyware/Virus infested PC's. (I am an IT tech for a small university, and we clean student's PC's for them... ) :o

The script downloads the latest Definition executable for Symantec Anti-Virus Corporate Edition, as well as AdAware Defs, Spybot S&D includes and the latest AVERT Stinger.

; Created 2/12/06 by Mike Matis

#NoTrayIcon 
#include <GUIConstants.au3>

$ping = ping ("www.google.com", 250)

;Generated with Form Designer preview
$Form1 = GUICreate("Update Tools", 264, 89, 522, 455)
$BUpdate = GUICtrlCreateButton("Update", 96, 56, 75, 25)
$Progress = GUICtrlCreateProgress(16, 32, 225, 17)
GUICtrlSetColor(-1, 0x0D0000)
$Status = GUICtrlCreateLabel("Click the 'Update' button to begin", 16, 8, 222, 20)
GUISetState(@SW_SHOW)
; Display GUI
While 1
    $msg = GuiGetMsg()
    Select
    Case $ping = 0
        MsgBox(0, "Error", "You must be connected to the Internet!")
        ExitLoop
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $BUpdate
        Update()
        MsgBox(0, "Update Complete", "The update is complete!")
        ExitLoop
    EndSelect
WEnd
Exit

Func Update()
$rev = 0
$day = @MDAY
$yrmon = @YEAR & @MON
$Datestamp = @MON & "-" & @MDAY & "-" & @YEAR & "-"

;Download the most recent SAV Definition Executable
GUICtrlSetData ($Status, "Looking for SAV Defs")
Do 
    If $rev = 20 Then
        $day = $day - 1
        $rev = 0
        Else
        EndIF
        
    Do
    $rev = $rev + 1
    $Defexists = InetGetSize ("http://definitions.symantec.com/defs/" & $yrmon & $day & "-00" & $rev & "-x86.exe")
    Until $Defexists > 500 or $rev = 9

If $rev = 9 AND $Defexists < 500 Then 
    Do 
        $rev = $rev + 1
        $Defexists = InetGetSize ("http://definitions.symantec.com/defs/" & $yrmon & $day &"-0" & $rev & "-x86.exe")
    Until $Defexists > 500 or $rev = 20
Else
EndIf
        
Until $Defexists > 500

GUICtrlSetData ($Progress, 10)

While $Defexists > 500
    If $rev <= 9 Then
        $DefName = $yrmon & $day & "-00" & $rev & "-x86.exe"
    Else
        $DefName = $yrmon & $day & "-0" & $rev & "-x86.exe"
    EndIf
    
GUICtrlSetData ($Status, "Downloading SAV Defs, - Be Patient")
GUICtrlSetData ($Progress, 20)

FileDelete (@ScriptDir & "\" & "200?????-0??-x86.exe")
InetGet("http://definitions.symantec.com/defs/" & $DefName, @ScriptDir & "\" & $DefName)
ExitLoop
WEnd

GUICtrlSetData ($Progress, 30)
GUICtrlSetData ($Status, "Downloading AdAware Defs")

;Download most recent AdAware Defs
FileDelete (@ScriptDir & "\" & "*defs.zip")
GUICtrlSetData ($Progress, 40)
InetGet("http://updates.ls-servers.com/public/defs.zip", @ScriptDir & "\" & $Datestamp & "-defs.zip")

GUICtrlSetData ($Progress, 55)
GUICtrlSetData ($Status, "Downloading SpyBot S&D Defs")

;Download most recent Spybot Search and Destroy Defs
FileDelete (@ScriptDir & "\" & "*includes.exe")
GUICtrlSetData ($Progress, 70)
InetGet("http://www.spybotupdates.com/updates/files/spybotsd_includes.exe", @ScriptDir & "\" & $Datestamp & "-includes.exe")

GUICtrlSetData ($Progress, 80)
GUICtrlSetData ($Status, "Downloading Latest AVERT Stinger")

;Download latest AVERT Stinger
FileDelete (@ScriptDir & "\" & "*-Stinger.exe")
GUICtrlSetData ($Progress, 90)
InetGet("http://download.nai.com/products/mcafee-avert/stng260.exe", @ScriptDir & "\" & $Datestamp & "-Stinger.exe")
GUICtrlSetData ($Progress, 100)
GUICtrlSetData ($Status, "Done!")
EndFunc

Thanks for looking! and please let me know if there's anything I can do to make this script better / cleaner.

I also hope someone finds it useful

Share this post


Link to post
Share on other sites



corvias, for those of that have to support our friend's and family's computers, this would be a nice thing for them to have. Then schedule a job to run this daily/weekly. It could be modified to launch the scanners (Adaware, Spybot S&D, anti-virus, etc) after they've been updated.

You can even be sneaky and disable the keybaord and mouse while it runs so they can't stop it (BlockInput(flag)). :o Just remember to enable them when you're done.

I see a lot of potential with this script. To increase the target market, it could update for a larger number of apps (e.g. add SpywareBlaster, Avast AV, McAfee, etc) and use an INI file to set which apps to download for or set it in the app or use both where the INI file overrides internal settings.

E.g.

#Start Update.ini

[Anti-Virus]

Symantec

;McAfee

;Avast

[Anti-Spyware]

SpybotS&D

AdAware

;SpywareBlaster

#End Update.ini

Just a thought. Thanks for sharing.

PS. I'm setting up a new XP PC for my folks this weekend and anything that I can't automate the update for in the app, I'll just AutoIt.

Share this post


Link to post
Share on other sites

Nice one. The script hangs at 'Looking for SAV Defs' and script can't be killed. Perhaps because PC didn't have Symantec installed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0