Jump to content

Newbie - cant get passed 2nd window CCleaner


Recommended Posts

Hi,

I can't believe my first script, after the tutorials, and I can't get passed the 2nd window when install CCleaner.

Basically, the first window is the Open File Security Warning in which I send the ENTER command that then brings me to the "Select Language" window.

I can't get passed this 2nd window???

The default language is English, so there's no need to access the dropdown box (I think) and it looks like the OK button is the default button.

Yet I've tried various ways to click the OK button (see code), but the window just stays put...

WTF am I doing wrong?

Thanks in advance

; install CCleaner (use latest version available)
Run("ccsetup305.exe")

; Open File Security Warning - press OK button
WinWaitActive("Open File - Security Warning","&Run")
ControlClick("Open File - Security Warning","Do you want to run this file?",4423)

;select language & press OK button (default is English)
WinWaitActive("Installer Language","Please select a language")
;Send("{ENTER}")
;ControlClick("Installer Language","Please select a language","[ID:1]")
;ControlClick("Installer Language","Please select a language","[CLASS:Button;;INSTANCE:1]")
ControlClick("Installer Language","Please select a language","[CLASS:Button;;INSTANCE:1]","left",1)
Link to comment
Share on other sites

Welcome to the forums ! Posted Image

Try this

; install CCleaner (use latest version available)
Run("ccsetup305.exe")

; Open File Security Warning - press OK button
_WaitAndActivate ( "Open File - Security Warning","&Run" )
ControlClick("Open File - Security Warning","Do you want to run this file?",4423)

;select language & press OK button (default is English)
_WaitAndActivate ( "Installer Language","Please select a language" )
ControlClick ( "Installer Language", "Please select a language", "Button1" )

Func _WaitAndActivate ( $_Title, $_Text )
   WinWait ( $_Title, $_Text )
   WinActivate ( $_Title, $_Text )
   WinWaitActive ( $_Title, $_Text )    
EndFunc ;==> _WaitAndActivate ( )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Welcome to the forums ! Posted Image

Try this

; install CCleaner (use latest version available)
Run("ccsetup305.exe")

; Open File Security Warning - press OK button
_WaitAndActivate ( "Open File - Security Warning","&Run" )
ControlClick("Open File - Security Warning","Do you want to run this file?",4423)

;select language & press OK button (default is English)
_WaitAndActivate ( "Installer Language","Please select a language" )
ControlClick ( "Installer Language", "Please select a language", "Button1" )

Func _WaitAndActivate ( $_Title, $_Text )
   WinWait ( $_Title, $_Text )
   WinActivate ( $_Title, $_Text )
   WinWaitActive ( $_Title, $_Text )    
EndFunc ;==> _WaitAndActivate ( )

Thanks for the function--another step my the learning process BUT it still doesn't work for me? Using the WindowInfo tool, I did see where the OK button has a ClassnameNN of "Button1" but substituting that in the ControlClick did not work. Perhaps there's something going on with my environment/setup?

Any other suggestions would be appreciated.

Thanks,

Payne

Link to comment
Share on other sites

place

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Debug_Mode=Y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

at the top of your script and run it.

You will see in the console which line blocks the script ! Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

place

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Debug_Mode=Y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

at the top of your script and run it.

You will see in the console which line blocks the script ! Posted Image

Thanks, the output in the console window doesn't reveal anything in particular to me...but what do I know? Does it tell you anything? The script still stops at the 2nd dialog.

thanks

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Debug_Mode=Y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:         myName

#ce ----------------------------------------------------------------------------
; install CCleaner (use latest version available)

Func _WaitAndActivate ( $_Title, $_Text )
   WinWait ( $_Title, $_Text )
   WinActivate ( $_Title, $_Text )
   WinWaitActive ( $_Title, $_Text )
EndFunc ;==> _WaitAndActivate ( )

Run( "ccsetup305.exe" )

; Open File Security Warning - press OK button
_WaitAndActivate ( "Open File - Security Warning","&Run" )
ControlClick( "Open File - Security Warning","Do you want to run this file?","" )

;select language & press OK button (default is English)
_WaitAndActivate ( "Installer Language","Please select a language" )
ControlClick ( "Installer Language", "Please select a language", "Button1" )

>"p:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\Payne Technologies\Tools\My AutoIt Scripts\CCleaner\CCleanerInstall-v3.au3" /autoit3dir "p:\Program Files\AutoIt3" /UserParams    
+>17:15:17 Starting AutoIt3Wrapper v.2.0.1.24    Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 3  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  from:p:\Program Files\AutoIt3
+>17:15:17 AU3Check ended.rc:0
>Running:(3.3.6.1):p:\Program Files\AutoIt3\autoit3.exe "D:\xxx\Tools\My AutoIt Scripts\CCleaner\CCleanerInstall-v3.au3"    
!> Starting in DebugMode..
Line: @error-@extended: Line syntax
0001: 0-0: #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
0002: 0-0: #AutoIt3Wrapper_Run_Debug_Mode=Y
0003: 0-0: #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
0004: 0-0: #cs ----------------------------------------------------------------------------
0012: 0-0: Func _WaitAndActivate ( $_Title, $_Text )
0018: 0-0: Run( "ccsetup305.exe" )
0021: 0-0: _WaitAndActivate ( "Open File - Security Warning","&Run" )
0013: 0-0:    WinWait ( $_Title, $_Text )
Edited by paynehd
Link to comment
Share on other sites

place

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Debug_Mode=Y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

at the top of your script and run it.

You will see in the console which line blocks the script ! Posted Image

I added the code and saw the output in the console window. See the snippet below.

The resolution was removing the "&" from all the button text strings that were parameters to the _WaitAndActivate function (WinWaitActivate from old code). I suppose going from the tutorials, where "hot-keys" were used, the button text showed the ampersand, ie "&Run", "&Next". In the code I am using, there are no hot-keys and therefore the button text should be "Run", "Next" etc...

Thanks for all your help,

Should I call you Sensei :unsure:

Thanks, the output in the console window doesn't reveal anything in particular to me...but what do I know? Does it tell you anything? The script still stops at the 2nd dialog.

thanks

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Debug_Mode=Y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:         myName

#ce ----------------------------------------------------------------------------
; install CCleaner (use latest version available)

Func _WaitAndActivate ( $_Title, $_Text )
   WinWait ( $_Title, $_Text )
   WinActivate ( $_Title, $_Text )
   WinWaitActive ( $_Title, $_Text )
EndFunc ;==> _WaitAndActivate ( )

Run( "ccsetup305.exe" )

; Open File Security Warning - press OK button
_WaitAndActivate ( "Open File - Security Warning","&Run" )
ControlClick( "Open File - Security Warning","Do you want to run this file?","" )

;select language & press OK button (default is English)
_WaitAndActivate ( "Installer Language","Please select a language" )
ControlClick ( "Installer Language", "Please select a language", "Button1" )

>"p:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\Payne Technologies\Tools\My AutoIt Scripts\CCleaner\CCleanerInstall-v3.au3" /autoit3dir "p:\Program Files\AutoIt3" /UserParams    
+>17:15:17 Starting AutoIt3Wrapper v.2.0.1.24    Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 3  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  from:p:\Program Files\AutoIt3
+>17:15:17 AU3Check ended.rc:0
>Running:(3.3.6.1):p:\Program Files\AutoIt3\autoit3.exe "D:\xxx\Tools\My AutoIt Scripts\CCleaner\CCleanerInstall-v3.au3"    
!> Starting in DebugMode..
Line: @error-@extended: Line syntax
0001: 0-0: #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
0002: 0-0: #AutoIt3Wrapper_Run_Debug_Mode=Y
0003: 0-0: #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
0004: 0-0: #cs ----------------------------------------------------------------------------
0012: 0-0: Func _WaitAndActivate ( $_Title, $_Text )
0018: 0-0: Run( "ccsetup305.exe" )
0021: 0-0: _WaitAndActivate ( "Open File - Security Warning","&Run" )
0013: 0-0:    WinWait ( $_Title, $_Text )

Link to comment
Share on other sites

I added the code and saw the output in the console window. See the snippet below.

The resolution was removing the "&" from all the button text strings that were parameters to the _WaitAndActivate function (WinWaitActivate from old code). I suppose going from the tutorials, where "hot-keys" were used, the button text showed the ampersand, ie "&Run", "&Next". In the code I am using, there are no hot-keys and therefore the button text should be "Run", "Next" etc...

Thanks for all your help,

Should I call you Sensei :unsure:

Spoke too soon...it still does not work.

I notice that after canceling each failed attempt that there was a new autoit process in the task bar...an accumulation of these in fact. When I reran the process, apparently it somehow ran through completion. So I deleted all the autoit task in the task bar and ran it again...still stuck at second dialog:

The console output doesn't tell me anything...

Any more ideas?

thanks,

>"p:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "D:\Payne Technologies\Tools\My AutoIt Scripts\CCleaner\CCleanerInstall-v3.au3" /autoit3dir "p:\Program Files\AutoIt3" /UserParams    
+>20:08:16 Starting AutoIt3Wrapper v.2.0.1.24    Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 3  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  from:p:\Program Files\AutoIt3
+>20:08:16 AU3Check ended.rc:0
>Running:(3.3.6.1):p:\Program Files\AutoIt3\autoit3.exe "D:\Payne Technologies\Tools\My AutoIt Scripts\CCleaner\CCleanerInstall-v3.au3"    
!> Starting in DebugMode..
Line: @error-@extended: Line syntax
0001: 0-0: #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
0002: 0-0: #AutoIt3Wrapper_Run_Debug_Mode=Y
0003: 0-0: #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
0004: 0-0: #cs ----------------------------------------------------------------------------
0012: 0-0: Func _WaitAndActivate ( $_Title, $_Text )
0018: 0-0: Run( "ccsetup305.exe" )
0021: 0-0: _WaitAndActivate ( "Open File - Security Warning","Do you want to run this file" )
0013: 0-0:    WinWait ( $_Title, $_Text )
Link to comment
Share on other sites

Looks to me like your script is waiting for a window. Perhaps your title and text are wrong for the 2nd window?

Then again, I've not used debug mode before.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

This is my first "Helping Reply", feels good to final be giving back :unsure:. I tested out your script on my Win XP box and was running into the same problem. I simply commented out the first _WaitAndActivate and ControlClick lines as shown below.

; install CCleaner (use latest version available)
Run("ccsetup305.exe") ; Open File Security Warning - press OK button

;_WaitAndActivate ( "Open File - Security Warning","Run" )
;ControlClick("Open File - Security Warning","Do you want to run this file?",4423) ;select language & press OK button (default is English)

_WaitAndActivate ( "Installer Language","Please select a language" )
ControlClick ( "Installer Language", "Please select a language", "OK" )

Func _WaitAndActivate ( $_Title, $_Text )


WinWait ( $_Title, $_Text )
WinActivate ( $_Title, $_Text )
WinWaitActive ( $_Title, $_Text )
EndFunc ;==> _WaitAndActivate ( )

It worked for me after doing that.

Hope this helps

Link to comment
Share on other sites

If script block to waiting window try this :

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Run_Debug_Mode=Y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:        myName

#ce ----------------------------------------------------------------------------
; install CCleaner (use latest version available)

Run( "ccsetup305.exe" )

; Open File Security Warning - press OK button
_WaitAndActivate ( "Open File - Security Warning","&Run", 3 )
ControlClick( "Open File - Security Warning","Do you want to run this file?","" )

;select language & press OK button (default is English)
_WaitAndActivate ( "Installer Language","Please select a language", 3 )
ControlClick ( "Installer Language", "Please select a language", "Button1" )

Func _WaitAndActivate ( $_Title, $_Text, $_Time=0 )
   WinWait ( $_Title, $_Text, $_Time )
   WinActivate ( $_Title, $_Text )
   WinWaitActive ( $_Title, $_Text, $_Time )
EndFunc ;==> _WaitAndActivate ( )

And if it doesn't work, cause title is not good , search for _ProcessGetHWnd or GetHwndFromPID ! Posted Image

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Thanks to all those who replied..I appreciate it very much.

Even though it still doesn't make sense to me, I took armymans suggestion to comment out the first wait and that takes care of the problem...whatever the problem is...

Payne

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...