Sign in to follow this  
Followers 0
neebo

dead end with Off2007 installer

8 posts in this topic

Hiya

As a AutoIt-n00b i'd like to axe a question, so bear with me:

Im currently working with a script which updates a) MS Off2000 > MS Off2007 ;) installs servicepack1 c) installs servicepack2

I've managed to start the Office-installer, set in the necessary options etc.

However I cant seem to make the script click the CLOSE-button on Off2007 -installer-window while the installation is complete. I tried to:

> send a keystroke !c

> control-click buttons coordinates

> added a While-loop which sleeps until the pixel color in Close-buttons coordinates changes from backround-color to something else ie. the button exists

No success. The script dont hit the close-button for me. After I click the button manually, the script continues to run ok.

What am I doing wrong here? Any feedback would be greatly appreciated.

Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc

$officetitle = "Microsoft Office Professional Plus 2007"

_WinWaitActivate( $officetitle,"NUIDocumentWindow" )
Send("<serial here>")
Send("!c")
Sleep(1000)
_WinWaitActivate( $officetitle,"NUIDocumentWindow" )
Send("!c")
_WinWaitActivate( $officetitle,"NUIDocumentWindow" )
Send("!s") 
Send("!e") 
Send(@ComputerName & "\" & @IPAddress1)
Send("!o")
Send("<company name here>)
Sleep(1000)
Send("!i") ; runs the installer, takes a while

;_WinWaitActivate( $officetitle,"NUIDocumentWindow" )
$vari = PixelGetColor(332, 358)
While Hex($vari) = "0xE7EFFF"
    Sleep(3000)
WEnd
Sleep(1000)
ControlClick( $officetitle, "", "", "left", 1, 329, 336 ) ;click close-button

WinWaitClose( $officetitle,"NUIDocumentWindow" )

_tooltip("Office2007 Installed", "installing SP1")

Enclosing a capture from the "installing..." and "done" -windows with AutoIt Window Info

http://img301.imageshack.us/img301/5481/off200701.jpg

http://img510.imageshack.us/img510/5228/off200702.jpg

Share this post


Link to post
Share on other sites



Have you tried using the button CLASSNN for the ControlClick? (remove the coordinates if you do, as they are relative to the button position)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Tvern,

Not yet, because the Window Info Tool gives the same ClassNN to both "installing"-window (which doesnt have the button) and "Done"-windows (which has the button).

Edited by neebo

Share this post


Link to post
Share on other sites

Just checked and it does indeed seem to recognise the entire inner window as a single control. Great.

I'm certain there are workarounds, but it might be best to read up on using command line switches.

Share this post


Link to post
Share on other sites

Tvern,

Thanks for the tip. Seems... interesting ;)

Im certainly going to have a look on this.

However - setting the command line switches up seems a lot of work, since the problem is caused by a single-missing-mouse-click - and the rest of the script is working perfectly.

If anyone has a easier workaround on this, pls share.

Thanks and have a good one!

Share this post


Link to post
Share on other sites

You could use a hybrid option of using the command line to specify an alternative config.xml file and in that file change the display level to "Basic" , which doesn't show the completion notice by default. I'm not sure that will offer you the amount of control you desire though.

Share this post


Link to post
Share on other sites

Hi

Its actually very easy to set up using command line switches. If you put copy your 2007 office cd to a folder on the c: for example called office2007. then start a command console and navigate to that folder.

type setup.exe /admin - this will start the wizard up which look s a little like the install.

Run throught the wizard and then save yor final msp file (i called mine unattended) to the same directory as the office setup file.

create your program and add the line

Run(@ScriptDir & '\office2007\setup.exe /adminfile unattended.MSP')

This will then do all that you require.


Drunken Frat-Boy Monkey Garbage

Share this post


Link to post
Share on other sites

This will then do all that you require.

Can't thank you enough, noble sir. Hallelujah!

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  
Followers 0