neogia Posted February 9, 2006 Share Posted February 9, 2006 Ok, so I'm trying to create a tool that will uninstall McAfee on new retail PCs, the tool runs absolutely beatifully and flawlessly when run as a script. But when I compile it, it doesn't complete. If you follow the code it will get through shutting down all the McAfee services, and close any McAfee processes, but it won't run the installer. I don't get it. Can someone please shed some light? As an added note. I tried to debug the UninstallString that the script finds, but the message box (Line 63)never displays, the exe just closes itself. expandcollapse popup;#include "MBCommon.au3" Local $title = "Services" Local $control = "SysListView321" Local $sub = "McAfee" Local $prog = 0 If ProcessExists("mghtml.exe") Then ProcessClose("mghtml.exe") EndIf ;_nfo($PROGRESS_UPDATE,$M_UNINST,$prog+10) Run(@COMSPEC& " /c Start c:\windows\system32\services.msc") Sleep(500) WinWaitActive("Services","Services (Local)") ;Find currently running McAfee Services $count = 0 Dim $services[10] $numItems = ControlListView($title,"",$control,"GetItemCount") For $i = 0 To $numItems - 1 If StringInStr(ControlListView($title,"",$control,"GetText",$i), $sub) <> 0 Then If ControlListView($title,"",$control,"GetText",$i,2) = "Started" Then $services[$count] = $i $count = $count + 1 EndIf EndIf Next ;Stop services that were found For $i = 0 To $count - 1 ControlListView($title,"", $control, "Select", $services[$i]) ControlFocus($title,"",$control) $text = ControlListView($title,"",$control,"GetText",$services[$i], 2) $subtitle = ControlListView($title,"",$control,"GetText",$services[$i]) & " Properties (Local Computer)" If $text = "Started" Then Send("{Enter}") WinWaitActive($subtitle,"") ControlClick($subtitle,"","Button2","Left") WinWaitActive($subtitle,"") ControlClick($subtitle,"","Button6","Left") If WinActive("Firewall Background Service Stopped") Then ControlClick("Firewall Background Service Stopped","","Button2","Left") EndIf WinWaitActive($title,"") EndIf Next ;_nfo($PROGRESS_UPDATE,$M_UNINST,50) ;Close services window WinClose($title) ;Close all McAfee processes Local $List = ProcessList() For $i = 1 To $List[0][0] If StringInStr($List[$i][0], "mc") Then ProcessClose($List[$i][1]) EndIf Next $unstring = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\McAfee Uninstall Utility","UninstallString") MsgBox(0,"unstring",$unstring) If $unstring <> "" Then Run(@COMSPEC& " /c Start "&$unstring) MsgBox(0,"","testing"&$unstring) WinWaitActive("McAfee Internet Security Suite","") Send("{SPACE}") Sleep(500) Send("{TAB}{SPACE}") EndIf ;_nfo($PROGRESS_UPDATE,$M_UNINST,100) WinWaitActive("vb script: Uninstall Wizard","") Send("{ENTER}") Sleep(100) Send("{SPACE}") ;Log Restart Needed ;_nfo($LOG_RESTART_NEEDED) [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia Link to comment Share on other sites More sharing options...
GaryFrost Posted February 9, 2006 Share Posted February 9, 2006 I'll take a wild guess your compiled exe name has mc in it SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
DaveF Posted February 9, 2006 Share Posted February 9, 2006 "Not cool, not cool at all." Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines. Link to comment Share on other sites More sharing options...
neogia Posted February 10, 2006 Author Share Posted February 10, 2006 I'll take a wild guess your compiled exe name has mc in it D'ohI probably would've found this easier if the script didn't run under "AutoIt.exe" I should've caught that. Many thanks Gafrost. Nice "wild guess", btw. [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia Link to comment Share on other sites More sharing options...
neogia Posted February 10, 2006 Author Share Posted February 10, 2006 And yes, my compiled exe was simply named: McAfeeUninstaller.exe :"> I promptly installed this into my code;Close all McAfee processes Local $List = ProcessList() For $i = 1 To $List[0][0] If StringInStr($List[$i][0], "mc") Then If $List[$i][0] <> "McAfeeUninstaller.exe" Then;You know, cause you wouldn't want to close this, right? ProcessClose($List[$i][1]) EndIf EndIf Next [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia Link to comment Share on other sites More sharing options...
Zach Posted February 13, 2006 Share Posted February 13, 2006 This thread reminds me of my life story... . . . 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