Enjoy Posted October 6, 2004 Share Posted October 6, 2004 Hello, we want to uninstall a program without typing any key. Therefore we try to use the following Script. It runs very good until the main uninstall dialog should be closed via sending the ENTER-key. Where is the mistake?? Another problem is that the While-Loop will never end, although the process IsUn0407.exe isn't running anymore. How would you do this via AdlibEnable for example?? ;---Our previous code --- While 1 Sleep(500) ;Commit any message for deleting not used files... If WinWaitActive("Freigegebene Datei") Then Send("!j") EndIf ;Commit the dialog where you can see, what the uninstall-process do (e.g. where the marks will be set when this certain action was done) [I hope you know what I mean.] If WinActive("Programme vom Computer entfernen") Then Sleep(1000) Send("{ENTER}") EndIf If NOT ProcessExists("IsUn0407.exe") Then Exit EndIf Wend ;---Rest of code --- Please help us, we are trying it for the last two days... enjoy Link to comment Share on other sites More sharing options...
sugi Posted October 6, 2004 Share Posted October 6, 2004 While 1 If WinWaitActive("Freigegebene Datei") Then Send("!j") EndIf If NOT ProcessExists("IsUn0407.exe") Then Exit EndIf WendI removed the lines not neccessary to reproduce the problem.I think your problem is WinWaitActive. I think you want to use WinActive. Link to comment Share on other sites More sharing options...
nobby Posted October 6, 2004 Share Posted October 6, 2004 You also may want to search the help file for "control". Things like controlclick allow you to click a button without having to worry about the window having the focus. I found it far better than sending keys when practical. CheersNobby Link to comment Share on other sites More sharing options...
Enjoy Posted October 6, 2004 Author Share Posted October 6, 2004 hello sugi, this loop is already working. we want to send the ENTER-Key to the last Dialog of uninstallation, where check marks are. hello nobby, ControlClick does not work, we checked every possibilty. Enjoy. Link to comment Share on other sites More sharing options...
sugi Posted October 6, 2004 Share Posted October 6, 2004 hello sugi,this loop is already working. we want to send the ENTER-Key to the last Dialog of uninstallation, where check marks are.hello nobby,ControlClick does not work, we checked every possibilty.The loop is not working or sending {ENTER} would work. WinWaitActive blocks the loop until the specified window comes up.Besides I'm pretty sure ControlClick will work. Try the command ControlClick('Programme vom Computer entfernen', '', 'OK'). Link to comment Share on other sites More sharing options...
MHz Posted October 6, 2004 Share Posted October 6, 2004 Hello Enjoy, Try inserting this code below the first EndIf. The 2nd If statement may not be true when executed too early. WinWaitActive("Programme vom Computer entfernen") Link to comment Share on other sites More sharing options...
Enjoy Posted October 6, 2004 Author Share Posted October 6, 2004 We got it: While ProcessExists("IsUn0407.exe") While WinActive("Freigegebene Datei") If WinWaitActive("Freigegebene Datei") Then Sleep(500) Send("!j") EndIf Wend WinActivate("Programme vom Computer entfernen") If WinActive("Programme vom Computer entfernen") Then Sleep(5000) Send("{SPACE}") EndIf If NOT ProcessExists("IsUn0407.exe") Then MsgBox (4096,"test","Kill Script") Exit EndIf Wend The point was to set Sleep(5000) before sending the SPACE, beacause the OK-Button was inactive ! Thanks for all replies ! Enjoy. Link to comment Share on other sites More sharing options...
sugi Posted October 6, 2004 Share Posted October 6, 2004 We got it:While WinActive("Freigegebene Datei") If WinWaitActive("Freigegebene Datei") Then Sleep(500) Send("!j") EndIf WendThere's still the same bug in it. Now you're telling AutoIt to loop while a specific window is active and then if this window is active wait until the window that's already active is active.Your solutions (adding a While, increasing the Sleep) are only dirty workarounds for this one small bug and are likely to cause problems e.g. if a computer is slower as you thought. 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