lunj 0 Posted April 28, 2010 Hi, I'm new to autoit. Developed a script to install/uninstall a program. It worked one day and stopped work the second day. Has anybody had this type of experience? My script is $sBase = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" $iEval = 1 $sSearch = "Fiery" While 1 $sUninst = "" $sDisplay = "" $sCurrent = RegEnumKey($sBase, $iEval) If @Error Then ExitLoop $sKey = $sBase & $sCurrent $sDisplay = RegRead($sKey, "DisplayName") If StringRegExp($sDisplay, "(?i).*" & $sSearch & ".*") Then $sUninst = RegRead($sKey, "UninstallString") If $sUninst Then Run($sUninst) WinwaitActive("Windows Installer") WinActive("Windows Installer") sleep(20) ControlClick("Windows Installer", "Are you sure you want to uninstall this product?", "Yes") EndIf EndIf $iEval += 1 WEnd It worked one day, but stopped working the second day. Anything wrong with it? Your help is greatly appreciated. Thanks Share this post Link to post Share on other sites
Zedna 279 Posted April 28, 2010 1) You havent specified what is wrong "stop working" is not sufficient 2) You should add some logic for waiting after ControlClick until each app is uninstalled 3) Add to your script some debug ConsoleWrite() to see what's going on and where it hangs Resources UDF ResourcesEx UDF AutoIt Forum Search Share this post Link to post Share on other sites
lunj 0 Posted April 28, 2010 1) You havent specified what is wrong "stop working" is not sufficient2) You should add some logic for waiting after ControlClick until each app is uninstalled3) Add to your script some debug ConsoleWrite() to see what's going on and where it hangsSorry for not making it clear.1. "Stop working" here means the pop up window "Windows Installer" can not be closed.---ControlClick("Fiery®VUE - InstallShield Wizard", "", "Ok") didn't work.Thanks for the guidance! I was a perl developer. Now it's new to autoit. Share this post Link to post Share on other sites
Fulano 1 Posted April 28, 2010 Also: please put your scripts in "autoit" tags, it makes it much easier to read.$sBase = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" $iEval = 1 $sSearch = "Fiery" While 1 $sUninst = "" $sDisplay = "" $sCurrent = RegEnumKey($sBase, $iEval) If @Error Then ExitLoop $sKey = $sBase & $sCurrent $sDisplay = RegRead($sKey, "DisplayName") If StringRegExp($sDisplay, "(?i).*" & $sSearch & ".*") Then $sUninst = RegRead($sKey, "UninstallString") If $sUninst Then Run($sUninst) WinwaitActive("Windows Installer") WinActive("Windows Installer") sleep(20) ControlClick("Windows Installer", "Are you sure you want to uninstall this product?", "Yes") EndIf EndIf $iEval += 1 WEnd #fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja! Share this post Link to post Share on other sites
Zedna 279 Posted April 28, 2010 Also use Au3Info tool for getting exact window's/control's titles/texts Resources UDF ResourcesEx UDF AutoIt Forum Search Share this post Link to post Share on other sites