Jump to content

Automatically install any program (Checkbox and radio button issues)


 Share

Recommended Posts

Hello guys, I am trying to automate the installation of any software. I know it is really hard, but I need to do it. I am struggling right now with checkboxes and radio buttons. How can I get the type of a button? "Window Info" tells me that a checkbox is a "button", is there anyway to make sure it is a checkbox? Radio button is the same...

And is there any easier way to automate the installation of any program? I mean programs like the ones you download from cnet or softonic.

Thanks!

Link to comment
Share on other sites

Welcome to the AutoIt forum Falcao544! :)

There is many ways to interact with controls. Using a function like:

ControlClick("[TITLE:example]", "text of control", "[ID:1020]") ;example usage of title special definitions and control definitions for parameters 1 and 3

As you can see, there are multiple ways to specify how you want to see the control. In the first parameter we can use:

TITLE - Window title
    CLASS - The internal window classname
    REGEXPTITLE - Window title using a regular expression (if the regular expression is wrong @error will be set to 2)
    REGEXPCLASS - Window classname using a regular expression (if the regular expression is wrong @error will be set to 2)
    LAST - Last window used in a previous AutoIt command
    ACTIVE - Currently active window
    X \ Y \ W \ H - The position and size of a window
    INSTANCE - The 1-based instance when all given properties match

like so:

"[TITLE:my window]"
"[ACTIVE]" ; this will get the window you have active
"[CLASS:button;INSTANCE:1]"

Same goes for the controls, but I hope this gives you an idea on more than one way of getting what you have accomplished.

Any chance you could tell us the software you are trying to automate and post the script you're using? Just makes it easier for us to see any problems or small errors. :D

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Thank you! I am aware of those ways of interacting with controls, but the only thing that makes radio buttons and checkboxes unique is their text (as far as I know), which may vary depending of the program. There isn't a specific software I am trying to automate. I would like to be able to install, for example, all the programs available on cnet website. This is for a study I am doing, related to computer security. That's why I really need it. I was able to install programs that don't require accepting "Terms" and "License Agreement", but I wasn't successfull with programs that require interactions with checkboxes and radio buttons. I was also not successful with programs that "Window Info" can't read inside the main window view. The script is in python using PyAutoit... Can I still post it?

Edited by Falcao544
Link to comment
Share on other sites

Anytime. Please, feel free to post it.

I do not have much knowledge of python and you'll have to wait for someone with a little more knowledge in the subject to join in. ;)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

For installation, I remember back than I used this example:

RunWait(@comspec & " /c " & 'msiexec /i "Vsetup7nd.msi" /qb /Lv* "C:\temp\install.log" Installalllevel=200 allusers=1')

and the installer must be msi with silent install support.

 

For the buttons, I would suggest using @GUI_CHECKED. Correct me if I'm wrong anybody!

Python... nevermind -.-

Edited by asianqueen

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")
Link to comment
Share on other sites

Use ControlCommand when dealing with checkboxes and radios.

It give a more reliable end state, depending if you want it 'checked' or 'unchecked'...where the controlclick will not (it will just change it to the opposite state of current)

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

Hey guys! Thanks for the suggestions! I was able to overcome the "checkbox issue"! AutoIT manages buttons and checkboxes the same way --' if you use ControlCommand (as said by jdelaney) with the command "check" on a normal button, it works as if you click on it... Now I just need to figure out how to manage radio buttons! Is there any way to differentiate radio buttons, buttons and checkboxes?

"where the controlclick will not (it will just change it to the opposite state of current)" nice observation!

asianqueen, in my case I can't use silent installer... But thank you anyway!

Thank you!

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