chaos945 Posted September 20, 2008 Posted September 20, 2008 I had this idea today but I don't have time to make it. Perhaps someone with more time wants to try.I have a USB drive with lots of misc tools on it. Lots of them require constant updates. The idea is to create either a GUI based list, that can easily be added to. Inputting the URL of the location to check for updates, and the location of the current copy of the file on the USB drive. Comparing the file size difference between the two, then downloading the updated file if a size difference is detected. Alternatively one could skip the GUI and just run a simpler script, modifying the list using an INI.Here is an example of how one might approach the above idea. I created this script to update my portable copy of AntiVir because the build-in updater breaks if the program is not correctly installed. The script checks the URL for a difference in size, it utilizes IZARCE.exe to then extract the ZIP'd file.If NOT FileGetSize("ivdf_fusebundle_nt_en.zip") = InetGetSize("http://dl.antivir.de/down/vdf/ivdf_fusebundle_nt_en.zip") Then MsgBox(0, "Avira AntiVir Updater", "Updates found. Please wait...", 5) FIleDelete("ivdf_fusebundle_nt_en.zip") InetGet("http://dl.antivir.de/down/vdf/ivdf_fusebundle_nt_en.zip", "ivdf_fusebundle_nt_en.zip", 1, 1) While @InetGetActive TrayTip("Downloading AntiVir Updates...", "Bytes = " & @InetGetBytesRead, 10, 16) Sleep(250) WEnd RunWait('IZARCE -e -o "ivdf_fusebundle_nt_en.zip"')Else MsgBox(0, "Avira AntiVir Updater", "No updates available.", 5)EndIfRun("avcenter.exe")ExitAlso here are some misc URL's I've collected that I was considering to use with the tool.ftp://ftp.symantec.com/public/english_us_...emoval_Tool.exehttp://download.bleepingcomputer.com/sUBs/ComboFix.exehttp://download.mcafee.com/products/licens...atches/MCPR.exe
Valuater Posted September 20, 2008 Posted September 20, 2008 (edited) kinda like.... expandcollapse popupDim $Ini_File = @ScriptDir & "\YOUR_FILE.ini" Dim $rFile, $rMsg, $rURL, $rRun, $rExe $var = IniReadSectionNames($Ini_File) If @error Then MsgBox(4096, "", "Error occurred, probably no INI file.") Exit Else For $i = 1 To $var[0] $rFile = IniRead($Ini_File, $var[$i], "File", "error") ; "ivdf_fusebundle_nt_en.zip" $rMsg = IniRead($Ini_File, $var[$i], "Message", "error") ; "Avira AntiVir" $rURL = IniRead($Ini_File, $var[$i], "URL", "error") ; "http://dl.antivir.de/down/vdf/ivdf_fusebundle_nt_en.zip" $rRun = IniRead($Ini_File, $var[$i], "Run", "error") ; 'IZARCE -e -o "ivdf_fusebundle_nt_en.zip"' $rExe = IniRead($Ini_File, $var[$i], "Exe", "error") ; "avcenter.exe" _Check_Updates() Next EndIf Func _Check_Updates() If Not FileGetSize($rFile) = InetGetSize($rURL) Then MsgBox(0, $rMsg, "Updates found. Please wait...", 5) FileDelete($rFile) InetGet($rURL, $rFile, 1, 1) While @InetGetActive TrayTip("Downloading " & $rMsg & " Updates...", "Bytes = " & @InetGetBytesRead, 10, 16) Sleep(250) WEnd If $rRun <> "error" Then RunWait($rRun) Else MsgBox(0, $rMsg & " Updater", "No updates available.", 5) Return EndIf If $rExe <> "error" Then Run($rExe) ; maybe RunWait() here EndFunc ;==>_Check_Updates 8) Edited September 20, 2008 by Valuater
chaos945 Posted September 20, 2008 Author Posted September 20, 2008 That is pretty slick. Thanks. It took me a minute to wrap my brain around your script, below is an example INI. [setup] File=ivdf_fusebundle_nt_en.zip Message=Avira AntiVir URL=http://dl.antivir.de/down/vdf/ivdf_fusebundle_nt_en.zip Run=IZARCE -e -o "ivdf_fusebundle_nt_en.zip Exe=avcenter.exe [setup2] File=ComboFix.exe Message=ComboFix URL=http://download.bleepingcomputer.com/sUBs/ComboFix.exe Run= Exe=
PartyPooper Posted September 21, 2008 Posted September 21, 2008 Have a look at InetFileUpdate in my siggy. It may be able to provide some help/ideas.
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