Jump to content
Sign in to follow this  
Boss007

intalling firefox

Recommended Posts

Boss007

Hi all, I am trying to write a simple script to install firefox on multiple machines and to uncheck the launch firefox button at the end of the installation.

I do not want to use the mouse click command to uncheck the box.

how do I uncheck boxes? or click on specific non default buttons? using the send or appropriate command and the info contained within Au3Info?

I know how to get the info about the windows and buttons but not how to use it or structure it within the script. Pleas help!!!

confused newbie!!!

Share this post


Link to post
Share on other sites
monoscout999

controlclick()?

EDIT: post a screen from the window info tool, when you select the checkbox

Here you got an example with calculator.

ShellExecute("calc")
$winHndl = WinWaitActive("[CLASS:CalcFrame]")
ControlClick($winHndl, "", "[CLASS:Button; INSTANCE:5]", "Left", 1)
Sleep(500)
ControlClick($winHndl, "", "[CLASS:Button; INSTANCE:23]", "Left", 1)
Sleep(500)
ControlClick($winHndl, "", "[CLASS:Button; INSTANCE:11]", "Left", 1)
Sleep(500)
ControlClick($winHndl, "", "[CLASS:Button; INSTANCE:28]", "Left", 1)

EDIT: I´m using Win7 if you use a different OS then maybe the instances of the buttons are different

Edited by monoscout999

Share this post


Link to post
Share on other sites
Casey

Hi all, I am trying to write a simple script to install firefox on multiple machines Pleas help!!!

For what you asked I believe the previous answer is what your looking for. From experience though you will see better results if you customize your installer options and then just execute your installer. What you are trying to do may work this time but the next go around the company may change things up and it may not. Here is a link to a resource that may be of benefit to you. You might build it in AutoIt as part of your learning process.

<http://mockbox.net/configmgr-sccm/174-install-and-configure-firefox-silently.html>

Once done, you could make use of the new -ms switch to deploy it silently with your autoit script.

Share this post


Link to post
Share on other sites
Boss007

Thanks for your response but I could not figure out how to use the controlclick command, I tried several variations and none worked

do i need to add the text for the button in the command?

here is my script that works fine but I dont like the mouse click command that only works on the same screen size as it was creasted on

if I change the screen size then the mouseclick command, clicks at the wrong location.

Run('D:\software\Firefox Setup 3.6.exe')

_WinWaitActivate("Mozilla Firefox Setup","Welcome to the Mozilla Firefox Setup Wizard")

Send ("{ENTER}")

_WinWaitActivate("Mozilla Firefox Setup","Choose setup options")

Send ("{ENTER}")

_WinWaitActivate("Mozilla Firefox Setup","Ready to start installing Firefox")

Send ("{ENTER}")

_WinWaitActivate("Mozilla Firefox Setup","Completing the Mozilla Firefox Setup Wizard")

;the following Mouse click command line is used to uncheck the firefox launch option

;this is the line I want to replace with a non mouse click command how could I use the send or controlclick()command here?

;based on the buton info produced by Au3info?

;The button info is as follows,

;Class Button

;Instsnce 4

;ClassnameaNN Button4

;Advanced Mode [CLASS:Button; INSTANCE:4]

;ID 1203

;Text &Launch Firefox now

;Position 180, 163

;size 293, 16

MouseClick("left",575,385,1)

Send ("{ENTER}")

Func _WinWaitActivate($title,$text,$timeout=0)

WinWait($title,$text,$timeout)

If Not WinActive($title,$text) Then WinActivate($title,$text)

WinWaitActive($title,$text,$timeout)

EndFunc

Share this post


Link to post
Share on other sites
monoscout999

see my example above and adapt it to your needs.

Share this post


Link to post
Share on other sites
Casey

For FireFox 3.6.19 here are two options that work

;Silent install
RunWait('C:\G6\Firefox'&" "&'Setup'&" "&'3.6.19.exe'&" "&'-ms')
;Brief msgbox that isn't needed
MsgBox(0,"Complete","Silent install complete",2)

or

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

Run('C:\G6\Firefox'&" "&'Setup'&" "&'3.6.19.exe')

WinWait("Mozilla Firefox Setup","Welcome to the Mozil")
If Not WinActive("Mozilla Firefox Setup","Welcome to the Mozil") Then WinActivate("Mozilla Firefox Setup","Welcome to the Mozil")
WinWaitActive("Mozilla Firefox Setup","Welcome to the Mozil")
ControlClick("Mozilla Firefox Setup", "", "&Next >")

WinWait("Mozilla Firefox Setup","Choose setup options")
If Not WinActive("Mozilla Firefox Setup","Choose setup options") Then WinActivate("Mozilla Firefox Setup","Choose setup options")
WinWaitActive("Mozilla Firefox Setup","Choose setup options")
ControlClick("Mozilla Firefox Setup", "", "&Next >")

WinWait("Mozilla Firefox Setup","Ready to start insta")
If Not WinActive("Mozilla Firefox Setup","Ready to start insta") Then WinActivate("Mozilla Firefox Setup","Ready to start insta")
WinWaitActive("Mozilla Firefox Setup","Ready to start insta")
ControlClick("Mozilla Firefox Setup", "", "&Install")

WinWait("Mozilla Firefox Setup ","Completing the Mozil")
If Not WinActive("Mozilla Firefox Setup ","Completing the Mozil") Then WinActivate("Mozilla Firefox Setup ","Completing the Mozil")
WinWaitActive("Mozilla Firefox Setup ","Completing the Mozil")
ControlClick("Mozilla Firefox Setup", "", "&Launch Firefox now")
ControlClick("Mozilla Firefox Setup", "", "&Install")

Share this post


Link to post
Share on other sites
Boss007

For what you asked I believe the previous answer is what your looking for. From experience though you will see better results if you customize your installer options and then just execute your installer. What you are trying to do may work this time but the next go around the company may change things up and it may not. Here is a link to a resource that may be of benefit to you. You might build it in AutoIt as part of your learning process.

<http://mockbox.net/configmgr-sccm/174-install-and-configure-firefox-silently.html>

Once done, you could make use of the new -ms switch to deploy it silently with your autoit script.

Many Thanks for the link it was an eye opener I am going to try to get my head round this method which makes more sence!

you have completly lost me on the -ms switch thing, but I hear the "deploy it silently with your autoit script"

could you explain this a litte more to me it sound perfect for what I want! once again thanks for taking the time out to help,

can you rep people on this forum?

Share this post


Link to post
Share on other sites
Casey

you have completly lost me on the -ms switch thing, but I hear the "deploy it silently with your autoit script"

could you explain this a litte more

Look at the first of the two options I posted. There appears to be some lag in your seeing my response.

1. The first option is a one liner that does everything that you initially were trying to do.

2. When I downloaded the installer it had spaces in it that is what the ' & " " & ' account for.

3. '-ms' at the end of the run statement is the silent switch.

4. Why version 3.6. This is a old version with security flaws? If your doing this now I would suggest getting the latest version unless there is some business requirement that can't run on the newest version.

Have a good one, I am headed out.

Share this post


Link to post
Share on other sites
somdcomputerguy

I would use ControlCommand rather than ControlClick in this case. But this is just a personal preference, and it shouldn't be taken that one way is better than the other..


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
Boss007

For FireFox 3.6.19 here are two options that work

;Silent install
RunWait('C:\G6\Firefox'&" "&'Setup'&" "&'3.6.19.exe'&" "&'-ms')
;Brief msgbox that isn't needed
MsgBox(0,"Complete","Silent install complete",2)

or

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

Run('C:\G6\Firefox'&" "&'Setup'&" "&'3.6.19.exe')

WinWait("Mozilla Firefox Setup","Welcome to the Mozil")
If Not WinActive("Mozilla Firefox Setup","Welcome to the Mozil") Then WinActivate("Mozilla Firefox Setup","Welcome to the Mozil")
WinWaitActive("Mozilla Firefox Setup","Welcome to the Mozil")
ControlClick("Mozilla Firefox Setup", "", "&Next >")

WinWait("Mozilla Firefox Setup","Choose setup options")
If Not WinActive("Mozilla Firefox Setup","Choose setup options") Then WinActivate("Mozilla Firefox Setup","Choose setup options")
WinWaitActive("Mozilla Firefox Setup","Choose setup options")
ControlClick("Mozilla Firefox Setup", "", "&Next >")

WinWait("Mozilla Firefox Setup","Ready to start insta")
If Not WinActive("Mozilla Firefox Setup","Ready to start insta") Then WinActivate("Mozilla Firefox Setup","Ready to start insta")
WinWaitActive("Mozilla Firefox Setup","Ready to start insta")
ControlClick("Mozilla Firefox Setup", "", "&Install")

WinWait("Mozilla Firefox Setup ","Completing the Mozil")
If Not WinActive("Mozilla Firefox Setup ","Completing the Mozil") Then WinActivate("Mozilla Firefox Setup ","Completing the Mozil")
WinWaitActive("Mozilla Firefox Setup ","Completing the Mozil")
ControlClick("Mozilla Firefox Setup", "", "&Launch Firefox now")
ControlClick("Mozilla Firefox Setup", "", "&Install")

Many Thanks! I tested your first example and it worked perfectly. You certainly know your stuff! this is a the best way that has been suggested

Its fast and light may I ask another favour could you explain this part of the code : '&" "&'Setup'&" "&'3.6.19.exe'&" "&'-ms') :

so I can understand what is going on here? can I install any software using this method ? once again thanks for taking the time out!

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.