Jump to content

7Zip


Recommended Posts

Still attempting to automate program installation, ran into another problem.

Currently, I am unable to get ControlClick to work. There must be something I am doing wrong here and I would like to have some advice on how to go about making the button click.

Here is the current code I have.

Run(@ScriptDir & "7-Zip 9.2.exe")
 
Local $7Zip = WinWaitActive ("7-Zip 9.20 Setup ","")
 
MsgBox ( $MB_OK, "Testing", "Going to click Install")
 
;ControlClick("7-Zip 9.20 Setup ", "", "[CLASS:Button; TEXT:&Install; INSTANCE:2]")
ControlClick( $7Zip, "", "[CLASS:Button; TEXT:&Install; INSTANCE:2]")
 
MsgBox ( $MB_OK, "Testing", "Hello")
 
When I run the code, it just skips over ControlClick without clicking anything.
Edited by Suppish
Link to comment
Share on other sites

Those identifications are generally mutually exclusive.

It's the second instance of a button, but it's the first instance of a button with that specific text.

Also, I'd recommend the use of the ID, instead...assuming the install is id=4:

ControlClick( $7Zip, "", 4)

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Why are you trying to automate the GUI for installation?  There is an MSI installer available that you can use to do a silent installation.  

msiexec.exe /i "7z920.msi" ALLUSERS=1 /qn /norestart /log output.log

Adam

Edited by AdamUL
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...