neebo Posted October 21, 2010 Share Posted October 21, 2010 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 Link to comment Share on other sites More sharing options...
Tvern Posted October 21, 2010 Share Posted October 21, 2010 Have you tried using the button CLASSNN for the ControlClick? (remove the coordinates if you do, as they are relative to the button position) Link to comment Share on other sites More sharing options...
neebo Posted October 21, 2010 Author Share Posted October 21, 2010 (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 October 21, 2010 by neebo Link to comment Share on other sites More sharing options...
Tvern Posted October 21, 2010 Share Posted October 21, 2010 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. Link to comment Share on other sites More sharing options...
neebo Posted October 21, 2010 Author Share Posted October 21, 2010 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! Link to comment Share on other sites More sharing options...
Tvern Posted October 21, 2010 Share Posted October 21, 2010 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. Link to comment Share on other sites More sharing options...
engjcowi Posted October 21, 2010 Share Posted October 21, 2010 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 Link to comment Share on other sites More sharing options...
neebo Posted October 25, 2010 Author Share Posted October 25, 2010 This will then do all that you require.Can't thank you enough, noble sir. Hallelujah! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now