dbecker Posted January 20, 2006 Posted January 20, 2006 I'm trying to have my script initiate and track a download with a progress, but I can't figure out how to have it do that. here is the complete script, the area in question is about towards the middle of it. expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> Dim $diagnose[28] Dim $n = 1 ProgressOn ("Now Diagnosing...","Please wait for the scan to finish") If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB873333", "Installed") then $diagnose[$n] = "Windows Update KB873333 Required" $n = $n + 1 EndIf ProgressSet (4) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB885250", "Installed") then $diagnose[$n] = "Windows Update KB885250 Required" $n = $n + 1 EndIf ProgressSet (8) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB886185", "Installed") then $diagnose[$n] = "Windows Update KB886185 Required" $n = $n + 1 EndIf ProgressSet (12) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB888113", "Installed") then $diagnose[$n] = "Windows Update KB888113 Required" $n = $n + 1 EndIf ProgressSet (16) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB891781", "Installed") then $diagnose[$n] = "Windows Update KB891781 Required" $n = $n + 1 EndIf ProgressSet (20) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB893066", "Installed") then $diagnose[$n] = "Windows Update KB893066 Required" $n = $n + 1 EndIf ProgressSet (24) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896358", "Installed") then $diagnose[$n] = "Windows Update KB896358 Required" $n = $n + 1 EndIf ProgressSet (28) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896422", "Installed") then $diagnose[$n] = "Windows Update KB896422 Required" $n = $n + 1 EndIf ProgressSet (32) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896423", "Installed") then $diagnose[$n] = "Windows Update KB896423 Required" $n = $n + 1 EndIf ProgressSet (36) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896424", "Installed") then $diagnose[$n] = "Windows Update KB896424 Required" $n = $n + 1 EndIf ProgressSet (40) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896688", "Installed") then $diagnose[$n] = "Windows Update KB896688 Required" $n = $n + 1 EndIf ProgressSet (43) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896727", "Installed") then $diagnose[$n] = "Windows Update KB896727 Required" $n = $n + 1 EndIf ProgressSet (45) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB899588", "Installed") then $diagnose[$n] = "Windows Update KB899588 Required" $n = $n + 1 EndIf ProgressSet (47) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB899589", "Installed") then $diagnose[$n] = "Windows Update KB899589 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (50) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB900725", "Installed") then $diagnose[$n] = "Windows Update KB900725 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (54) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB901017", "Installed") then $diagnose[$n] = "Windows Update KB901017 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (57) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB901214", "Installed") then $diagnose[$n] = "Windows Update KB901214 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (61) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB902400", "Installed") then $diagnose[$n] = "Windows Update KB902400 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (64) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB904706", "Installed") then $diagnose[$n] = "Windows Update KB904706 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (68) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB905414", "Installed") then $diagnose[$n] = "Windows Update KB905414 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (71) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB905749", "Installed") then $diagnose[$n] = "Windows Update KB905749 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (75) If NOT FileExists ("C:\Program Files\Symantec AntiVirus\VPTray.exe") then $diagnose[$n] = "Norton Anti-Virus Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (82) If NOT FileExists ("C:\Program Files\Cisco Systems\Clean Access Agent\CCAAgent.exe") then $diagnose[$n] = "Cisco Clean Access Agent Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (86) If NOT FileExists ("C:\Program Files\Mozilla Firefox\firefox.exe") Then $diagnose[$n] = "Mozilla Firefox Optional" $n = $n + 1 EndIf Sleep (200) ProgressSet (89) If NOT FileExists ("C:\Program Files\Spybot - Search & Destroy\SpybotSD.exe") Then $diagnose[$n] = "Spy-Bot Search and Destroy Optional" $n = $n + 1 EndIf Sleep (200) ProgressSet (93) If NOT FileExists ("C:\Program Files\Lavasoft\Ad-Aware SE Personal\Ad-Aware.exe") Then $diagnose[$n] = "Ad-Aware SE Personal Optional" $n = $n + 1 EndIf Sleep (200) ProgressSet (96) If NOT FileExists ("C:\WINDOWS\Driver Cache\i386\sp2.cab") Then $diagnose[$n] = "WindowsXP Service Pack2 Required" $n = $n + 1 EndIf Sleep (200) ProgressSet (97) If NOT FileExists ("C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe") Then $diagnose[$n] = "Adobe Acrobat Reader 6.0 Optional" $n = $n + 1 EndIf Sleep (200) ProgressSet (98) If NOT FileExists ("C:\Program Files\Trillian\trillian.exe") Then $diagnose[$n] = "Trillian Instant Messenger Optional" $n = $n + 1 EndIf Sleep (200) ProgressSet (100) ProgressOff() DirCreate ("C:\Ubertor Patch") DirCreate ("C:\WINDOWS\system32\oobe\images\IMT") GUICreate("The RezNet Setup Application",640,480); will create a dialog box that when displayed is centered FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\imtlogo.jpg", "C:\WINDOWS\system32\oobe\images\IMT\imtlogo.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\HelpFile.html", "C:\Ubertor Patch\HelpFile.html") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\Updating_Symantec_Antivirus.html", "C:\Ubertor Patch\Updating_Symantec_Antivirus.html") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\start.jpg", "C:\Ubertor Patch\start.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\end.jpg", "C:\Ubertor Patch\end.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\finish.jpg", "C:\Ubertor Patch\finish.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\LiveUpdate.jpg", "C:\Ubertor Patch\LiveUpdate.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\main.jpg", "C:\Ubertor Patch\main.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\tray.jpg", "C:\Ubertor Patch\tray.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\updating.jpg", "C:\Ubertor Patch\updating.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\windows.jpg", "C:\WINDOWS\system32\oobe\images\IMT\windows.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\symantec.jpg", "C:\WINDOWS\system32\oobe\images\IMT\symantec.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\firefox.jpg", "C:\WINDOWS\system32\oobe\images\IMT\firefox.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\ccaa.jpg", "C:\WINDOWS\system32\oobe\images\IMT\ccaa.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\sbsdlogo.jpg", "C:\WINDOWS\system32\oobe\images\IMT\sbsdlogo.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\adobereader.jpg", "C:\WINDOWS\system32\oobe\images\IMT\adobereader.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\trillian.jpg", "C:\WINDOWS\system32\oobe\images\IMT\trillian.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\adaware.jpg", "C:\WINDOWS\system32\oobe\images\IMT\adaware.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\apulogoteal.jpg", "C:\Windows\system32\oobe\images\IMT\apulogoteal.jpg") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\bar.jpg", "C:\Windows\system32\oobe\images\IMT\bar.jpg") GUISetFont(9, 300) GUISetBkColor(0x415A57) $tab=GUICtrlCreateTab (0,0,640,25) GUICtrlSetColor (-1, 0xB1B1AD) $tab0=GUICtrlCreateTabitem ("Scan Results") $tab0imtpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\imtlogo.jpg",320,26,320,237) $tab0apupic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\apulogoteal.jpg",198,385,122,78) $tab0scanlabel=GUICtrlCreateLabel ("The programs and updates that you need are listed below.",320,267,320,20) GUICtrlSetColor (-1, 0xB1B1AD) Local $List = '' For $I = 1 To $N - 1 $List = $List & $Diagnose[$I] & @CRLF Next $Font = "Times New Roman Bold" $Tab0Edit = GUICtrlCreateEdit($List,320,285,320,152, $ES_AUTOVSCROLL + $WS_VSCROLL) GUICtrlSetColor (-1, 0xB1B1AD) GUISetBkColor (-1, 0x415A57) GUICtrlSetColor (-1, 0xB1B1AD) $tab0ReScan=GUICtrlCreateButton ("Re-Scan",320,436,320,25) GUICtrlSetColor (-1, 0xB1B1AD) $tab0InstructionsLabel=GUICtrlCreateLabel ("Instructions:",1,26,320,20) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab0InstructionsLabel,15,450,0,$Font) $tab0InfoLabel=GUICtrlCreateLabel ("Use the scan results provided to determine what needs are still required by the machine being serviced. Then proceed to the 'Required Programs and Updates' tab to get the required items, and to the 'Optional Programs' tab to get the programs that are not required, but still helpful.",0,48,320,450) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab0InfoLabel,11,150,0,$Font) GUISetBkColor (-1, 0x415A57) ;$tab0datelabel=GUICtrlCreateLabel ("This data on this cd, particularly the updates, are current through January 6th, 2006.",0,415,200,60) $tab1=GUICtrlCreateTabitem ("Required Updates and Programs") $tab1imtpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\imtlogo.jpg",320,26,320,237) $tab1Edit = GUICtrlCreateEdit("",320,263,320,220,$ES_MULTILINE + $ES_AUTOVSCROLL + $WS_EX_TRANSPARENT) GUISetBkColor (-1, 0x415A57) GUICtrlSetColor (-1, 0xB1B1AD) $tab1XPPatchLabel=GUICtrlCreateLabel ("1. Install Required Windows Updates",80,32,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab1XPPatchLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab1windowspic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\windows.jpg",0,26,80,90) $tab1XPPatch=GUICtrlCreateButton ("Install",80,51,240,30) $tab1XPPatchInfo=GUICtrlCreateButton ("Information",80,81,240,30) $tab1barpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\bar.jpg",0,115,320,3) $tab1SP2Label=GUICtrlCreateLabel ("2. Install Windows XP Service Pack 2",80,126,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab1SP2Label,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab1SP2=GUICtrlCreateButton ("Install",80,146,240,30) $tab1SP2Info=GUICtrlCreateButton ("Information",80,176,240,30) $tab1CCAALabel=GUICtrlCreatelabel ("3. Install Cisco Clean Access Agent",80,221,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab1CCAALabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab1ccaapic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\ccaa.jpg",0,211,80,97) $tab1barpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\bar.jpg",0,210,320,3) $tab1CCAA=GUICtrlCreateButton ("Install",80,241,240,30) $tab1CCAAInfo=GUICtrlCreateButton ("Information",80,271,240,30) $tab1barpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\bar.jpg",0,310,320,3) $tab1NortonLabel=GUICtrlCreateLabel ("4. Install APU's Norton AntiVirus",80,316,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab1NortonLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab1nortonpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\symantec.jpg",0,313,80,92) $tab1Norton=GUICtrlCreateButton ("Install",80,336,240,30) $tab1NortonInfo=GUICtrlCreateButton ("Information",80,366,240,30) $tab1barpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\bar.jpg",0,402,320,3) $tab1NortonUpdateLabel=GUICtrlCreateLabel ("5. Install the latest Virus Definitions",80,411,240,25,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab1NortonUpdateLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab1NortonUpdatesInfo=GUICtrlCreateButton ("Information",80,429,240,30) ;tab2 creation $tab2=GUICtrlCreateTabItem ("Optional Programs") $tab2imtpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\imtlogo.jpg",320,26,320,237) $tab2Edit = GUICtrlCreateEdit("",320,263,320,220,$ES_MULTILINE + $ES_AUTOVSCROLL + $WS_EX_TRANSPARENT) GUISetBkColor (-1, 0x415A57) GUICtrlSetColor (-1, 0xB1B1AD) $tab2AdAwareLabel=GUICtrlCreateLabel ("1. Install Ad-Aware SE Personal",80,32,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab2AdAwareLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab2adawarepic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\adaware.jpg",0,26,80,90) $tab2AdAware=GUICtrlCreateButton ("Install",80,51,240,30) $tab2AdAwareInfo=GUICtrlCreateButton ("Information",80,81,240,30) $tab2barpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\bar.jpg",0,115,320,3) $tab2SpyBotLabel=GUICtrlCreatelabel ("2. Install SpyBot Search and Destroy",80,121,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab2SpyBotLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab2sbsdpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\sbsdlogo.jpg",0,119,80,90) $tab2SpyBot=GUICtrlCreateButton ("Install",80,140,240,30) $tab2SpyBotInfo=GUICtrlCreateButton ("Information",80,170,240,30) $tab2barpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\bar.jpg",0,204,320,3) $tab2FireFoxLabel=GUICtrlCreateLabel ("3. Install Mozilla Firefox Version 1.5",80,211,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab2FireFoxLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab2firefoxpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\firefox.jpg",0,214,80,70) $tab2Firefox=GUICtrlCreateButton ("Install",80,228,240,30) $tab2FirefoxInfo=GUICtrlCreateButton ("Information",80,258,240,30) $tab2barpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\bar.jpg",0,292,320,3) $tab2TrillianLabel=GUICtrlCreateLabel ("4. Install Trillian Instant Messenger",80,296,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab2TrillianLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab2trillianpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\trillian.jpg",0,298,80,80) $tab2Trillian=GUICtrlCreateButton ("Install",80,315,240,30) $tab2TrillianInfo=GUICtrlCreateButton ("Information",80,345,240,30) $tab2barpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\bar.jpg",0,381,320,3) $tab2AcrobatLabel=GUICtrlCreateLabel ("6. Install Adobe Acrobat Reader",80,392,240,25,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab2AcrobatLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) $tab2adobepic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\adobereader.jpg",0,392,80,70) $tab2Acrobat=GUICtrlCreateButton ("Install",80,429,240,30) $tab2AcrobatInfo=GUICtrlCreateButton ("Information",80,410,240,27) $tab3=GUICtrlCreateTabItem ("Additional Optional Programs") $tab3imtpic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\imtlogo.jpg",320,26,320,237) $tab3Edit = GUICtrlCreateEdit("",320,263,320,220,$ES_MULTILINE + $ES_AUTOVSCROLL + $WS_EX_TRANSPARENT) GUISetBkColor (-1, 0x415A57) GUICtrlSetColor (-1, 0xB1B1AD) $tab3AutoRuns=GUICtrlCreateLabel ("1. Install AutoRuns",80,32,240,20,$SS_CENTER) GUICtrlSetColor (-1, 0xB1B1AD) GUICtrlSetFont ($tab2AdAwareLabel,10,400,0,$Font) GUICtrlSetColor (-1, 0xB1B1AD) ;$tab3adawarepic=GUICtrlCreatePic(@Systemdir & "\oobe\images\IMT\adaware.jpg",0,26,80,90) $tab3Autoruns=GUICtrlCreateButton ("Install",80,51,240,30) $tab3AutorunsInfo=GUICtrlCreateButton ("Information",80,81,240,30) GUICtrlCreateTabitem (""); end tabitem definition $filemenu = GUICtrlCreateMenu ("&File",-1,1) $helpmenu = GUICtrlCreateMenu ("&Help") $helpitem = GUICtrlCreateMenuitem ("Help",$helpmenu) $exititem = GUICtrlCreateMenuitem ("Exit",$filemenu) $abootitem = GUICtrlCreateMenuitem ("Aboot",$helpmenu) GUISetState () Do $msg = GUIGetMsg () Select Case $msg = $tab1XPPatch $url = "http://www.genericurl.com/xppatch.exe" $size = InetGetSize($url) GUICreate ("Downloading", 300,120) $progress = GUICtrlCreateProgress (10,40,280,20) $buttonstart = GUICtrlCreateButton ("Start Download",75,80,70,20) $buttonrun = GUICtrlCreateButton ("Run Installer",150,80,70,20) $label = GUICtrlCreateLabel ("Click 'Start' to download installer",40,15,200,20) GUISetState () Select Case $msg = $buttonstart InetGet($url, @scriptdir & "\xppatch.exe", 0, 1) While @InetGetActive $currentsspercent = (100 * @InetGetBytesRead) / $size GUICtrlSetData($progress, $currentsspercent);, "download in progress") Wend Case $msg = $buttonrun Run (@scriptdir & "\xppatch.exe") EndSelect Case $msg = $tab1Norton FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\Norton 10 Installer.exe", "C:\Ubertor Patch\Norton 10 Installer.exe") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\Norton 10 Installer2.exe", "C:\Ubertor Patch\Norton 10 Installer2.exe") Run ("C:\Ubertor Patch\Norton 10 Installer2.exe") Case $msg = $tab2AdAware FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\aawsepersonal.exe", "C:\Ubertor Patch\aawsepersonal.exe") Run ("C:\Ubertor Patch\aawsepersonal.exe") Case $msg = $tab1CCAA FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\CCAAgent_Setup.exe", "C:\Ubertor Patch\CCAAgent_Setup.exe") Run ("C:\Ubertor Patch\CCAAgent_Setup.exe") Case $msg = $tab2Firefox FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\Firefox Setup 1.5.exe", "C:\Ubertor Patch\Firefox Setup 1.5.exe") Run ("C:\Ubertor Patch\Firefox Setup.exe") Case $msg = $tab2Acrobat FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\AcrobatSetup.exe", "C:\Ubertor Patch\AcrobatSetup.exe") Run ("C:\Ubertor Patch\AcrobatSetup.exe") Case $msg = $tab2Trillian FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\Trillian.exe", "C:\Ubertor Patch\Trillian.exe") Run ("C:\Ubertor Patch\Trillian.exe") Case $msg = $tab2SpyBot FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\SpyBotSD AutoInstaller.exe", "C:\Ubertor Patch\SpyBotSD AutoInstaller.exe") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\spybotsd14.exe", "C:\Ubertor Patch\spybotsd14.exe") FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\spybotsdupdates.exe", "C:\Ubertor Patch\spybotsdupdates.exe") Run ("C:\Ubertor Patch\SpyBot AutoInstaller.exe") Case $msg = $tab1SP2 FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\WindowsXP-KB835935.exe", "C:\Ubertor Patch\WindowsXP-KB835935.exe") Run ("C:\Ubertor Patch\WindowsXP-KB835935.exe") Case $msg = $tab1XPPatchInfo GUICtrlSetData ($tab1Edit, "Windows Updates: This program will automatically detect and install all of the post-Service Pack 2 updates that are required to access the network. If Windows XP Service Pack 2 showed up in your scan results, please install that before proceeding to these.") Case $msg = $tab1SP2Info GUICtrlSetData ($tab1Edit, "Windows XP Service Pack 2: This is a very large package of updates and hotfixes for Windows XP. Most 'factory fresh' computers now come with it pre-installed, but if the 'Scan Results' tab indicates that you require it, please install it before proceeding to other Windows updates. Be aware that this installation will usually take between 30 minuntes and 2 hours, depending on your computer. It will require you to restart your computer once it is finished installing.") Case $msg = $tab1NortonInfo GUICtrlSetData ($tab1Edit, "Norton AntiVirus: This is APU's corporate edition of Norton Anti-Virus. While you are required to have an antivirus program, and keep it updated, you do not necessarilly have to use ours. However, this version has a four-year subscription with it to Live-Update for up-to-date virus definitions. If you need to and are going to install this one, please un-install other versions of Norton, as well as other anti-virus programs before installing this one.") Case $msg = $tab1CCAAInfo GUICtrlSetData ($tab1Edit, "Cisco Clean Access Agent: This is the program that you must use to log on to the student networks. Clean Access scans your computer, checking for required programs and updates. You must have Windows and you antivirus programs completly up to date to access the network so that we can ensure a safe working environment.") Case $msg = $tab1NortonUpdatesInfo $url = "C:\Ubertor Patch\Updating_Symantec_Antivirus.html" Run("C:\Program Files\Internet Explorer\iexplore.exe " & $url) Case $msg = $tab2AdAwareInfo GUICtrlSetData ($tab2Edit, "Ad-Aware SE Personal: This program is a popular, effective anti-spyware program. While Optional for the network, it is still a wise program to have on hand for regular use.") Case $msg = $tab2FirefoxInfo GUICtrlSetData ($tab2Edit, "Mozilla Firefox 1.5: This program is a web browser that is a very widely acceptable alternative to using Internet Explorer. Firefox is one of the best alternatives around, featuring tabbed browsing, better security, and a more enjoyable user experience. Please note that it is not a requirement, nor is it supported by APU yet.") Case $msg = $tab2TrillianInfo GUICtrlSetData ($tab2Edit, "Trillian Basic 3: This program is a popular alternative to using AIM, MSN, and Yahoo! instant messenger programs. It combines all of them in to one program, and does not include spyware programs like WeatherBug in installation. This program is also not a requirement, but is a cool program to have on hand as an alternative that we feel should be suggested.") Case $msg = $tab2AcrobatInfo GUICtrlSetData ($tab2Edit, "Adobe Acrobat Reader: You do not have the most current version of Acrobat Reader. This program is used to open .pdf files, which is a standard file type often used in web-publishing and document distribution. You will not be able to open these file types without Acrobat Reader. This is also not a requirement for network access.") Case $msg = $tab2SpyBotInfo GUICtrlSetData ($tab2Edit, "SpyBot Search and Destroy: This program is a popular, effective anti-spyware program. While Optional for the network, it is still a wise program to have on hand for regular use.") Case $msg = $tab2 GUICtrlSetData ($tab1Edit, "") Case $msg = $tab1 GUICtrlSetData ($tab2Edit, "") Case $msg = $tab3AutorunsInfo GUICtrlSetData ($tab3edit, "Autorun: Displays all loading programs and utilities.") Case $msg = $tab3AutoRuns FileInstall ("C:\Documents and Settings\David Becker\My Documents\Work\Ubertor Patch\technician distribution\autoruns.exe", "C:\Ubertor Patch\autoruns.exe") Run ("C:\Ubertor Patch\autoruns.exe") Case $msg = $tab0ReScan GUICtrlSetData ($tab0Edit, "") Dim $diagnose2[28] Dim $p = 1 ProgressOn ("Now Diagnosing...","Please wait while we scan your computer") If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB873333", "Installed") then $diagnose2[$p] = "Windows Update KB873333 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (4) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB885250", "Installed") then $diagnose2[$p] = "Windows Update KB885250 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (8) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB886185", "Installed") then $diagnose2[$p] = "Windows Update KB886185 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (12) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB888113", "Installed") then $diagnose2[$p] = "Windows Update KB888113 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (16) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB891781", "Installed") then $diagnose2[$p] = "Windows Update KB891781 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (20) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB893066", "Installed") then $diagnose2[$p] = "Windows Update KB893066 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (24) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896358", "Installed") then $diagnose2[$p] = "Windows Update KB896358 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (28) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896422", "Installed") then $diagnose2[$p] = "Windows Update KB896422 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (32) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896423", "Installed") then $diagnose2[$p] = "Windows Update KB896423 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (36) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896424", "Installed") then $diagnose2[$p] = "Windows Update KB896424 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (40) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896688", "Installed") then $diagnose2[$p] = "Windows Update KB896688 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (43) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB896727", "Installed") then $diagnose2[$p] = "Windows Update KB896727 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (45) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB899588", "Installed") then $diagnose2[$p] = "Windows Update KB899588 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (47) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB899589", "Installed") then $diagnose2[$p] = "Windows Update KB899589 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (50) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB900725", "Installed") then $diagnose2[$p] = "Windows Update KB900725 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (54) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB901017", "Installed") then $diagnose2[$p] = "Windows Update KB901017 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (57) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB901214", "Installed") then $diagnose2[$p] = "Windows Update KB901214 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (61) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB902400", "Installed") then $diagnose2[$p] = "Windows Update KB902400 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (64) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB904706", "Installed") then $diagnose2[$p] = "Windows Update KB904706 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (68) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB905414", "Installed") then $diagnose2[$p] = "Windows Update KB905414 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (71) If NOT RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB905749", "Installed") then $diagnose2[$p] = "Windows Update KB905749 Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (75) If NOT FileExists ("C:\Program Files\Symantec AntiVirus\VPTray.exe") then $diagnose2[$p] = "Norton Anti-Virus Required" $n = $n + 1 EndIf Sleep (150) ProgressSet (80) If NOT FileExists ("C:\Program Files\Cisco Systems\Clean Access Agent\CCAAgent.exe") then $diagnose2[$p] = "Cisco Clean Access Agent Required" $p = $p + 1 EndIf Sleep (150) ProgressSet (86) If NOT FileExists ("C:\Program Files\Mozilla Firefox\firefox.exe") Then $diagnose2[$p] = "Mozilla Firefox Optional" $p = $p + 1 EndIf Sleep (150) ProgressSet (89) If NOT FileExists ("C:\Program Files\Spybot - Search & Destroy\SpybotSD.exe") Then $diagnose2[$p] = "Spy-Bot Search and Destroy Optional" $p = $p + 1 EndIf Sleep (150) ProgressSet (93) If NOT FileExists ("C:\Program Files\Lavasoft\Ad-Aware SE Personal\Ad-Aware.exe") Then $diagnose2[$p] = "Ad-Aware SE Personal Optional" $p = $p + 1 EndIf Sleep (150) ProgressSet (96) If NOT FileExists ("C:\WINDOWS\Driver Cache\i386\sp2.cab") Then $diagnose2[$p] = "WindowsXP Service Pack2 Required" $p = $p + 1 EndIf ProgressSet (97) If NOT FileExists ("C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe") Then $diagnose2[$p] = "Adobe Acrobat Reader 7.0 Optional" $p = $p + 1 EndIf ProgressSet (98) If NOT FileExists ("C:\Program Files\Trillian\trillian.exe") Then $diagnose2[$p] = "Trillian Instant Messenger Optional" $p = $p + 1 EndIf ProgressSet (100) ProgressOff() Local $List2 = '' For $h = 1 To $p - 1 $List2 = $List2 & $Diagnose2[$h] & @CRLF Next GUICtrlSetData ($tab0edit, $List2) EndSelect If $msg = $GUI_EVENT_CLOSE Or $msg = $exititem Then FileRecycle ("C:\Ubertor Patch") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\imtlogo.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\adaware.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\adobereader.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\apulogoteal.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\ccaa.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\firefox.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\symantec.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\trillian.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\windows.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\sbsdlogo.jpg") FileRecycle ("C:\WINDOWS\system32\oobe\images\IMT\bar.jpg") Exitloop EndIf If $msg = $helpitem Then $url = "C:\Ubertor Patch\HelpFile.html" Run("c:\program files\internet explorer\iexplore.exe " & $url) EndIf If $msg = $abootitem Then MsgBox (0, "Aboot", "RezNet Setup Application Student V3.0. ") Until $msg = $GUI_EVENT_CLOSE "I wish I could say something that was classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory lasts forever." - Shane Falco, The Replacements
seandisanti Posted January 20, 2006 Posted January 20, 2006 I'm trying to have my script initiate and track a download with a progress, but I can't figure out how to have it do that. here is the complete script, the area in question is about towards the middle of it.i'm pretty sure i saw a thread to do the exact same thing within the last week or so on this forum, i'll look it up and link you.
seandisanti Posted January 20, 2006 Posted January 20, 2006 i'm pretty sure i saw a thread to do the exact same thing within the last week or so on this forum, i'll look it up and link you.ah, that was YOURS. are you able to download the files manually? Sounds like a silly question, i know, but check to make sure.
dbecker Posted January 20, 2006 Author Posted January 20, 2006 ah, that was YOURS. are you able to download the files manually? Sounds like a silly question, i know, but check to make sure.the download runs if I just have it grab the file with inetget, wait for it to finish, then run it, but you don't know when it's finished or how far along the download is. the file will go, but I want to be able to track the download. lol nobody was responding anymore and I need this for work so I re-posted. I tried what people suggested in the other thread but it just wasn't working. also I dont' know anything about parent/child windows with gui's so when I close the gui created for the progress it closes the parent window, too. if you know anything about how to stop that from happening that would be cool, too "I wish I could say something that was classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory lasts forever." - Shane Falco, The Replacements
seandisanti Posted January 20, 2006 Posted January 20, 2006 the download runs if I just have it grab the file with inetget, wait for it to finish, then run it, but you don't know when it's finished or how far along the download is. the file will go, but I want to be able to track the download. lol nobody was responding anymore and I need this for work so I re-posted. I tried what people suggested in the other thread but it just wasn't working. also I dont' know anything about parent/child windows with gui's so when I close the gui created for the progress it closes the parent window, too. if you know anything about how to stop that from happening that would be cool, too i very seldom use progress bars, so the second issue i couldn't help at all. Do you really need a progress bar, or just an indicator that the file has finished downloading? because you could.... $tmp = filegetsize($whatever) sleep(500) while $tmp <> filegetsize($whatever) $tmp = filegetsize($whatever) sleep(500) Wend msgbox(0,"file's done","the file size hasn't changed in half a second, so it's probably done") not pretty, but it works. for figuring the progress bar, i still say that you could jsut do a standard progress bar and update it with $currentfilesize/$inetgetsize & "%"
Moderators SmOke_N Posted January 20, 2006 Moderators Posted January 20, 2006 I use this on one of my scripts:ProgressOn('Downloading', '') Local $netDnFileSize = InetGetSize('link to file') While @InetGetActive ProgressSet((@InetGetBytesRead / $netDnFileSize) * 100, '', 'Update' & " " & Round((@InetGetBytesRead / $netDnFileSize) * 100) & '% Done') Sleep(250) Wend ProgressOff() Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
dbecker Posted January 20, 2006 Author Posted January 20, 2006 Thank you! you just made my life a whole lot easier. Much appreciated!!!! "I wish I could say something that was classy and inspirational, but that just wouldn't be our style. Pain heals. Chicks dig scars. Glory lasts forever." - Shane Falco, The Replacements
Moderators SmOke_N Posted January 20, 2006 Moderators Posted January 20, 2006 Thank you! you just made my life a whole lot easier. Much appreciated!!!!Good deal, I hadn't messed with anything like this till last week... I was actually impressed with the accuracy... Glad to help! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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