Another alternative which I have explored is using the Superdat files. They do the following (approximately, don't sue me):1) look for any antivirus products in their line
2) check the version of the pattern files
3) check the version of the engine
4) unzip files
5) stop the antivirus program
6) update pattern files (takes effect without reboot)
7) update engine (needs a reboot)
8) restart the antivirus software
All in one neat executable.. it leaves a logfile which you specify on the commandline.
The only issue I have had with this is that I need to write something which examines the output from a TLIST command (list of processes) to force the updater script to wait for the antivirus to finish loading before running the superdat file (because otherwise I have seen the two fight when the updater fires off at the same time the antivirus is loading, it will spit out a corrupt definitions-file message)...
Here's my script-- (built around my main logon script, but hope this helps also)
; /* UPDATES ANTIVIRUS ENGINE AND VIRUS PATTERN DEFINITIONS FOR BOTH 95/NT */
;
;
;
; $script_name is the name of this script without the extension
If $os = "Windows 95"
$Rtn = Exist ("c:\program files\network associates\mcafee virusscan\vshwin32.exe")
If $Rtn = 0
; /* Not installed on Win95 */
? "Antivirus not installed for Win95, exiting script"
$continue=1
Return
Else
? "Detected antivirus software for Win95"
Endif
Endif
; loop...
; Grep a tlist output of processes and wait until the antivirus has completed starting
; before running the superdat install to avoid conflicts
; fail after a certain time period of not finding the antivirus software process..
; Code looking for different types of updates (sdat, pattern only, etc...)
; Right now it is only configured to work if a single sdat file is found in the update dir
; /* Read the filename in the directory to know what to run automatically (dir sdat*.exe) */
; If more than one is detected, then compare the file dates
; (set manually until coded)
$sdat_dir = "$updates_directory\$script_name"
; /* Obtain the filename of the superdat file or abort on error */
? "Scanning for sdat files in: $sdat_dir"
$sdat = ""
$FileName = Dir("$sdat_dir\sdat*.exe")
While ($FileName <> "") and (@ERROR = 0)
If $sdat = ""
$sdat = $Filename
? "Found: $sdat_dir\$sdat"
Else
? "Found: $sdat_dir\$filename"
? "Error: Multiple sdat files detected, script aborting"
; shell net send mis error message...
$Continue=1
Return
Endif
$Filename = Dir() ; retrieve next file
Loop
If $sdat = ""
? "No sdat files found"
$Continue=1
Return
Endif
$superdat = $sdat
;$superdat = "sdat4043.exe"
? "Current version : $superdat"
; /* Exit if we've already received the current update */
If $stage_completed = $superdat
? "No new update available"
$continue=1
Return
Endif
$av_logfile = "$script_name" + ".txt"
? "Deleting old logfile: $logfile_directory\$av_logfile"
del "$logfile_directory\$av_logfile"
copy "$updates_directory\$script_name\$superdat" "$logfile_directory"
$av_logcmd = "/logfile $logfile_directory\$av_logfile"
$cmd = "%comspec% /e:1024 /c $logfile_directory\$superdat /silent $av_logcmd"
; /* Sleep some to give the antivirus program a chance to startup and avoid conflicts */
sleep 5
? "Executing: $cmd"
shell "$cmd"
; /* Read logfile to determine if the update failed */
; Product may not be installed... if this is the case, send an alert to mis,
; then set stage_completed = ""
;
; Determine any other reasons why it may have failed (already had newest pattern)..etc
$stage_completed = $superdat
$continue=1
Return