Jump to content

Newbie trying to automate installs. Problem with radio buttons.


Recommended Posts

Hi everyone,

I have been playing with AutoIT for a couple of days now and am impressed with the functionality.

My aim is to automate a software install. I have experimented with a VLC and Ccleaner install and all works well (after a lot of messing!).

I am not a natural coder but here are my scripts below:-

VLC

run ( "c:\vlc-2.0.3-win32.exe" )
WinWaitActive ("Installer Language")
ControlClick ("Installer Language", "English", "[CLASS:Button;INSTANCE:1]")
WinWaitActive ("VLC media player 2.0.3 Setup", "Welcome to the VLC media player 2.0.3 Setup Wizard")
ControlClick ("VLC media player 2.0.3 Setup", "Welcome to the VLC media player 2.0.3 Setup Wizard", "[CLASS:Button;INSTANCE:2]")
WinWaitActive ("VLC media player 2.0.3 Setup", "License Agreement")
ControlClick ("VLC media player 2.0.3 Setup", "License Agreement", "[CLASS:Button;INSTANCE:2]")
WinWaitActive ("VLC media player 2.0.3 Setup", "Choose Components")
ControlClick ("VLC media player 2.0.3 Setup", "Choose Components", "[CLASS:Button;INSTANCE:2]")
WinWaitActive ("VLC media player 2.0.3 Setup", "&Install")
ControlClick ("VLC media player 2.0.3 Setup", "&Install", "[CLASS:Button;INSTANCE:2]")
WinWaitClose ("VLC media player 2.0.3 Setup", "Installing")
WinWait ("VLC media player 2.0.3 Setup", "&Finish")
WinwaitActive ("VLC media player 2.0.3 Setup", "&Finish")
ControlClick ("VLC media player 2.0.3 Setup", "&Finish", "[CLASS:Button;INSTANCE:2]")

Ccleaner

run ( "c:\ccsetup321.exe" )
WinWaitActive ("Installer Language", "English")
ControlClick ("Installer Language", "English", "[CLASS:Button; INSTANCE:1]")
WinWaitActive ("CCleaner v3.21 Setup", "Welcome to the CCleaner v3.21 Setup Wizard")
ControlClick ("CCleaner v3.21 Setup", "Welcome to the CCleaner v3.21 Setup Wizard", "[CLASS:Button; INSTANCE:2]")
WinWaitActive ("CCleaner v3.21 Setup", "1. SOFTWARE LICENSE AGREEMENT")
ControlClick ("CCleaner v3.21 Setup", "1. SOFTWARE LICENSE AGREEMENT", "[CLASS:Button; INSTANCE:2]")
WinWait ("CCleaner v3.21 Setup", "Install Options")
ControlClick ("CCleaner v3.21 Setup", "Install Options", "[CLASS:Button; INSTANCE:2]")
WinWait ("CCleaner v3.21 Setup", "Click Finish to close this wizard.")
WinWaitActive ("CCleaner v3.21 Setup", "Click Finish to close this wizard.")
ControlClick ("CCleaner v3.21 Setup", "Click Finish to close this wizard.", "[CLASS:Button; INSTANCE:2]")

I was hoping someone could tell me if I am doing things right and also how do I interact with radio buttons? eg. selecting options for no desktop shortcuts or agreeing to license agreements.

Many thanks

Link to comment
Share on other sites

You should be able to do this completely silent without having to automate the GUI for both installations. Try

VLC

Run("C:vlc-2.0.3-win32.exe /L=1033 /S", "", @SW_HIDE)

CCleaner

Run("C:ccsetup321.exe /S", "", @SW_HIDE)

/S switch is case sensitive.

To delete the VLC desktop shortcut use

FileDelete(@DesktopCommonDir & "VLC media player.lnk")

I'll let you figure out how to delete the shortcut for CCleaner.

If you want to automate the GUI, take a look at the ControlCommand in the help file.

Adam

Edited by AdamUL
Link to comment
Share on other sites

Many thanks,

I am only experimenting with VLC and Ccleaner before moving onto the software i really want to install (doesnt have a silent install option).

I will need to run the software install on machines across our domain.

I have learnt the runas command now as well and I can get VLC to install on a remote machine. The problem I am getting is that since I cannot figure out how to interact with the radio buttons (specifically the one that says "run VLC when I click finish") I get a message from "windows interactive services" when VLC launches.

Basically I would like to know how to interact with radio buttons.

Is it ControlSend by any chance?

Link to comment
Share on other sites

First, I don't want to nit pick, but you are actually wanting to interact with checkboxes, not radio buttons. Anyways, here's what I can tell you.

The checkboxes in VLC were grouped together as a single instance, so you cannot interact with them individually.

Here's an example of a checkbox being unchecked on CCleaner:

ControlClick ("CCleaner v3.21 Setup", "Install Options", "[CLASS:Button; INSTANCE:7]", "left")

Lastly, you may not realize it, but CCleaner offers a version without the toolbar. It is called CCleaner Slim. I recommend using it instead. Same goes for their other software titles.

Edited by abberration
Link to comment
Share on other sites

I have figured out that ControlCommand is the function needed to uncheck radio buttons.

I have successfully managed to install VLC to a remote machine using domain credentials and it works well.

However I would really like to install as a local administrator and I am stuck on this. This is my code:

RunAs ("myusername", "mc9056", "mypassword", "0", "c:/vlcscript.exe")

my user name is myusername

my machine name is mc9056

my password is mypassword

I have replaced the 0 with 1 and 2 and it still wont work.

So close yet so far.

Last post today!

Link to comment
Share on other sites

I have figured out that ControlCommand is the function needed to uncheck radio buttons.

I have successfully managed to install VLC to a remote machine using domain credentials and it works well.

However I would really like to install as a local administrator and I am stuck on this. This is my code:

RunAs ("myusername", "mc9056", "mypassword", "0", "c:/vlcscript.exe")

my user name is myusername

my machine name is mc9056

my password is mypassword

I have replaced the 0 with 1 and 2 and it still wont work.

So close yet so far.

Last post today!

This always works for me:

RunAs("administrator", @ComputerName, "password", 1, "myprog.exe")
Link to comment
Share on other sites

Do I enter @computername or "computername" in the code?

EDIT: Got it working now.

Done messing with VLC now, on to the main reason I have decided to use AutoIT now. Hope its a simple install.

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