Jump to content

Unable to Click Button During 'Silent Uninstall'


Recommended Posts

I am having difficulty with a silent uninstall for an older version of Dell Sonicwall.

I have a command that should run a silent install: msiexec.exe /X{0E14625B-DF56-4657-8678-DFD1955BE97A} /qn /norestart

However, it is not completely silent and there is a dialogue box that pops up. All I need to do is simply click ‘continue’ and this is where my problem lies.

 

With AutoIt, or AHK and other macro recorders, I’m unable to click the continue button or alternatively press enter and finish the uninstall. If I am just playing around I can see my mouse click at the given point on screen, but it cannot seem to focus or click on that dialogue window.

 

Here’s the button summary from AutoIt Info:

 

 

>>>> Window <<<<

Title:      Global VPN Client

Class:     #32770

Position:              430, 215

Size:       506, 297

Style:     0x94C800CC

ExStyle: 0x00010101

Handle: 0x0000000000170654

>>>> Control <<<<

Class:     Button

Instance:             3

ClassnameNN:  Button3

Name: 

Advanced (Class):            [CLASS:Button; INSTANCE:3]

ID:          1

Text:      Continue

Position:              404, 234

Size:       87, 24

ControlClick Coords:       23, 12

Style:     0x50010000

ExStyle: 0x00000004

Handle: 0x00000000001B07D8

>>>> Mouse <<<<

Position:              430, 272

Cursor ID:            0

Color:    0xC1E1E1

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Uninstall Global VPN Client

The uninstallation of Global VPN Client is almost complete. The following actions can be performed as part of the uninstallation process.

Click Continue to complete the uninstallation.

&Delete all settings and configuration files

&Retain the MAC address of the virtual adapter

Continue

>>>> Hidden Text <<<<

 

 

Here is my code:

 

#RequireAdmin

run("msiexec.exe /X{0E14625B-DF56-4657-8678-DFD1955BE97A} /qb /norestart")

AutoItSetOption('MouseCoordMode', 0)

WinWait('Global VPN Client', 'Click Continue')

WinActivate('Global VPN Client')

Send("{TAB}{TAB}{ENTER}")

Sleep(300)

;MouseClick('primary', 447, 272, 1, 0)    //Doesn't work

;ControlClick('Global VPN Client', 'Click Continue', 1)    //Doesn't work

 

 

I am running this script using #requireadmin, any suggestions or advice is appreciated.

Sonicwall_writeup.PNG

Link to comment
Share on other sites

Control click didn’t work because you’re not using it correctly go through all the parameters and set them. the name of the button is continue, not whatever you listed in that function

 

Also you have to make sure to wait for that control to actually exist

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Please use this tool when you post code.

Try always using handles instead of string to access windows and controls.  Here an example based on your script :

#RequireAdmin
#include <Constants.au3>

run("msiexec.exe /X{0E14625B-DF56-4657-8678-DFD1955BE97A} /qb /norestart")

Local $hWnd = WinWait('Global VPN Client')
If Not $hWnd Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error on title")
WinActivate($hWnd)
Local $hCtrl = ControlGetHandle($hWnd, "", "Button3")
If Not $hCtrl Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error on control")
ControlClick($hWnd, "", $hCtrl)

 

Link to comment
Share on other sites

@Earthshine

Thanks for your reply... I've tried a bunch of variations on control click but I've never had any luck. Here's a few more examples:

ControlClick('Global VPN Client', '', "Button3")

ControlClick('Global VPN Client', '', "Continue")  

ControlClick('Global VPN Client', '', 1) 

Link to comment
Share on other sites

@Nine

Thanks for giving me that example, it's far cleaner and I'll try to work off of that in any future AutoIt scripts. Sadly, I'm still struggling on the same issue with your provided script. There are no msgboxes that popup with your error message, but also the button still remains unclicked. Any further ideas on what I can try?

Link to comment
Share on other sites

put a longer sleep before trying to click the button. if that works then it means you just need to wait longer for the button to exist. I have a small script that waits for controls automatically for using on installers

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

and try controlclick like this if you don't want to get handles, but getting the handle is something my udf does for you based on the dialog and buttons on the form. this ensures that you are speaking to the correct instance of your control.

 

ControlClick("[CLASS:#32770]", "Global VPN Client", "[CLASS:Button; INSTANCE:3]", "Continue")

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

@Earthshine  4th parameter of ControlClick

Quote
button [optional] The button to click, "left", "right", "middle", "main", "menu", "primary", "secondary". Default is the left button.

Not "Continue"...

Link to comment
Share on other sites

@Earthshine

No luck with your your revised ControlClick, the wait I have here seems to trigger correctly and at the right time:

WinWait("Global VPN Client", "Click Continue")

 But the click just never seems to do anything.

 

@Nine

I've tried compiling and running the script in both x64 and x86 and no luck either.

 

Thanks both you two for helping me out with this issue and sticking with me. I really appreciate the efforts, but that button is one stubborn button that doesn't want to be pressed lol.

Link to comment
Share on other sites

Link to comment
Share on other sites

this is what my script outputs to console, it finds it and says it's clicked, gets a success from ControlClick but it doesn't work. I see what he means

#AutoIt3Wrapper_Compression=3
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#RequireAdmin

#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#include 'log4a.au3'
#include 'WaitForControls.au3'

Const $TD_BTN_CONTINUE = 'Continue'

Const $apptext = "Global VPN Client"
Const $text = "Global VPN Client"
Const $class = "[Class:#32770]"
Const $button3 = "[CLASS:Button; INSTANCE:3]"

#Region ;**** Logging ****
; Enable logging and don't write to stderr
_log4a_SetEnable()
; Write to stderr, set min level to warn, customize message format
_log4a_SetErrorStream()
_log4a_SetCompiledOutput($LOG4A_OUTPUT_FILE)
_log4a_SetMinLevel($LOG4A_LEVEL_DEBUG)
; If @compiled Then _log4a_SetMinLevel($LOG4A_LEVEL_WARN) ; Change the min level if the script is compiled
_log4a_SetFormat("${date} | ${host} | ${level} | ${message}")
#EndRegion ;**** Logging ****

;run("msiexec.exe /X{0E14625B-DF56-4657-8678-DFD1955BE97A} /qb /norestart")

Global $handle = WinActivate($text)
_log4a_Info($text & ' Handle :' & $handle)
_checkClickCtrl($class, $text, $button3, $TD_BTN_CONTINUE, 0)

01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | Control Text Found: Continue
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | Found Formclass: [Class:#32770]
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | Found Text: Global VPN Client
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | Found Control: [CLASS:Button; INSTANCE:3]
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | Found Ctrl Txt: Continue
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | Timeout: 0
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | Time Delay (after click): 0
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | [CLASS:Button; INSTANCE:3]
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | Control [CLASS:Button; INSTANCE:3] return code success: 1
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | ExitLoop:Normal - [CLASS:Button; INSTANCE:3]
01\08\2021 11:34:20 | WIN-ACFPG50M0SU | Info | _checkClickCtrl():End

 

to run my code you need the au3 files in the include, both can be found on this forum. note, you must get to this screen in order to try to execute the script, that installer does other things like removes virtual adapters that have been previously set up. SO just get to that point and execute the script

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

5 minutes ago, Nine said:

@Earthshine Can you try to ControlSend {TAB} and {SPACE}, see if that works ?

So you can see my udf find the control and attempt to click it, Once the script runs that control is highligted.

I added a Send("{ENTER}") at the very end of the script (even though I was still doing a ControlClick on that beast) and it doesn't do anything.

My resources are limited. You must ask the right questions

 

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...