rajeshontheweb Posted April 30, 2009 Share Posted April 30, 2009 (edited) Retrieves the list of update files availableArray First row gives the number of files and starting pathThe information is retrieved from FTP Location but the files can be downloaded from HTTP locationFile name mask and File type mask can be given, default retireves all exe files (example explains it)Error handling still being worked on. at the moment the udf just works great if internet is availabel and symantec is reachable!Comments pls...expandcollapse popup;~ #cs Example #include <Array.au3> ConsoleWrite("Retrieving information..."& @CRLF ) Local $array = _GetSymantecFileList(@YEAR, "exe") If Not @ERROR Then ConsoleWrite("Operation Completed, Listing goes here...."& @CRLF &@CRLF) Else ConsoleWrite(@EXTENDED) EndIf _ArrayDisplay($array) Local $OutputString = "" $OutputString &= @CRLF & " Total File(s) found : " & $array[0][0] $OutputString &= @CRLF & " File Names are relative to : " & $array[0][1] & @CRLF $OutputString &= @CRLF & "Sl " & @TAB & "File Name{Output[Sl][0]}" & @TAB & " File MD5{Output[Sl][1]} " & @TAB & @TAB & @TAB & "Download path " For $i = 1 to $array[0][0] ;~ $OutputString &= @CRLF & "File " & $i & " File Name: " & $array[$i][0] & " File MD5 Hash: " & $array[$i][1] & @CR & @TaB & " Download from : " & $array[0][1] & "/" & $array[$i][0] $OutputString &= @CRLF & $i & @TAB & $array[$i][0] & @TAB & $array[$i][1] & @TaB & $array[0][1] & $array[$i][0] Next ConsoleWrite($OutputString & @CRLF ) ;~ #ce Func _GetSymantecFileList($Mask = " ", $Type = "exe") ; Author: Rajesh V R ; Last Modified : 29 Apr 2009 If StringLen($Mask) = 0 Then $Mask = " " If StringLen($Type) = 0 Then $Type = " " Local $FileDir = _CreateFilesDirectory() Local $md5File_remote = "ftp://anonymous:@ftp.symantec.com/public/english_international/antivirus_definitions/norton_antivirus/md5-hash.txt" Local $md5File_local = $FileDir & "md5-hash.txt" Local $retArr[1][2], $tmpArr If InetGetSize($md5File_remote) == FileGetSize($md5File_local) Then ; Local file is of same size as latest file, so it can be used. Else InetGet($md5File_remote, $md5File_local, 1, 1) EndIf $FileHandle = FileOpen($md5File_local, 0) If @error Then SetError(@error, "Error opening file " & $md5File_local) ; -1 if file could not be opened While 1 $Line = FileReadLine($FileHandle) If @error = -1 Then ExitLoop ; Check if the line contains space , i.e., is in required 'FileName<Space>MD5Value' or '#<space>Comment' format If StringInStr($Line, " ") = 0 Then ContinueLoop ; Check for comment If StringMid($Line, 1, 1) = "#" Then ; save the remote folder location ConsoleWrite(@TAB & StringMid($Line, StringInStr($Line, "Paths relative to ") + 18, StringLen($Line) - StringInStr($Line, "Paths relative to "))) $retArr[0][1] = StringMid($Line, StringInStr($Line, "Paths relative to ") + 18, StringLen($Line) - StringInStr($Line, "Paths relative to ")) ContinueLoop EndIf ; Filter the results using the searchmask specified (" " if none) If StringInStr($Line, $Mask) = 0 Then ContinueLoop ; Filter the results using the filetypemask specified (" " if none) If StringInStr($Line, $Type) = 0 Then ContinueLoop $tmpArr = StringSplit($Line, " ") ReDim $retArr[UBound($retArr) + 1][2] $retArr[UBound($retArr) - 1][0] = $tmpArr[2] $retArr[UBound($retArr) - 1][1] = $tmpArr[1] $retArr[0][0] = UBound($retArr) - 1 WEnd SetError(0, "Operation Completed Successfully") Return $retArr EndFunc ;==>_GetSymantecFileList Func _CreateFilesDirectory() Local $retDir If DirCreate(@ScriptDir & "\Files") Then $retDir = @ScriptDir & "\Files\" Else ; there was an error creating directory $retDir = @ScriptDir & "\" EndIf Return $retDir EndFunc ;==>_CreateFilesDirectory<edit> 03 May 2009 : Just example modified... Edited May 3, 2009 by rajeshontheweb Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
BrettF Posted April 30, 2009 Share Posted April 30, 2009 (edited) *Sigh* I went to my tech guy the other day with mum to replace some faulty components, and he started it up to show us it was working. So we sat there, and then hes like... ohh I know why... *Taps the norton icon* But this is pretty good looking netherless. Edited April 30, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
rajeshontheweb Posted April 30, 2009 Author Share Posted April 30, 2009 i do understand 100% if people complain a lot about symantec. i personally do it, too. but our corporate environment has symantec AV installed (many companies do!) and i'm working on an easier life with it... Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
oshaker Posted April 30, 2009 Share Posted April 30, 2009 i do understand 100% if people complain a lot about symantec. i personally do it, too. but our corporate environment has symantec AV installed (many companies do!) and i'm working on an easier life with it... If I am using symantec endpoint protection, which packages should I use from the downloaded file? Link to comment Share on other sites More sharing options...
GEOSoft Posted April 30, 2009 Share Posted April 30, 2009 You can solve #5 with If Ping("ftp://symantec.com") Then Local $array = _GetSymantecFileList(@YEAR, "exe") _ArrayDisplay($array) EndIf George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
rajeshontheweb Posted April 30, 2009 Author Share Posted April 30, 2009 (edited) its the v5i32.exe for symantec end point protection. (use v5i32 as the file mask, you will get the required files listing u can choose from) i am working on another script for my network colleagues who will access the update file based on the installed symantec version.. Edited April 30, 2009 by rajeshontheweb Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now