nick.kirby Posted July 22, 2004 Posted July 22, 2004 Hello, I want to write scripts to automate installing software that we all need: Adaware, spy/mal preventers, acrobat, quicktime, winzip and so on, using scripts. I stumbled upon autoit and am trying my first script, one to install Winzip 9. I made some notes as I went through and came up with this script: Run,winzip90.exe ;runs winzip exe Send, {ENTER} ;clicks yes to setup Send, {ENTER} ;accepts default path Send, {ENTER} ;accepts setup Send, {ENTER} ;accepts agreement Send, {ENTER} ;accepts quickstart Send, {ENTER} ;accepts classic, and does next Send, {ENTER} ;express install Send, {ENTER} ;associates with default archives Send, {ENTER} ;finishes installation (in theory.~) ;program opens ;WinClose ;should close winzip window. it flops over at the first hurdle, opening lots of winzips, so it's in some sort of loop. please don't laugh- i know it's terrible, but I don't know why. I am not a programmer, I'm an engineer! I just want to write a script for each program, have them called by a master script and walk away, knowing in ten minutes all my apps will be installed safely! All help most gratefully received, many thanks in advance, Nick
CyberSlug Posted July 22, 2004 Posted July 22, 2004 If this is your first experience with AutoIt, then you may want to try version 3 Actually I recommend you use the "unstable" autoit-v3.0.102.exeYou will also want to look at the WinWait function to ensure that the clicks are sent at the right time.Here's a sample of version 3 syntax to get you started:Run("winzip90.exe") ;run WinZip installer $title = "WinZip® 9.0 Setup" WinWait($title) ControlClick($title,"", "&Setup") ;yes to setup $title = "WinZip Setup" WinWait($title) ControlClick($title,"", "OK");accept default path $title = "WinZip Setup" WinWait($title, "Thank you for installing WinZip!") ControlClick($title,"", "&Next >");Next $title = "License Agreement and Warranty Disclaimer" WinWait($title) ControlClick($title,"", "&Yes");agree to license ; ....You can use the AutoIt Window Spy (included with AutoIt v3) to get the names and text of windows.If a button caption contains an underlined letter, such as OK then you need to precede the name with an ampersand (&).If you still want to use version 2, then follow Larry's advice (which I just saw as I was previewing my message before posting.) Also note that you can send the Tab key to navigate between buttons--which you might need to to on the License Agreement window. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
CyberSlug Posted July 22, 2004 Posted July 22, 2004 By the way, you may want to look at 7-zip as an alternative to WinZip; and also look at QuickTime Alternative Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Beastmaster Posted July 22, 2004 Posted July 22, 2004 I am not a programmer, I'm an engineer!I really know what you're talking about Well, have a look if one (or hopefully all) of this apps providing some options/switches/parameters to run an unattended installation !) In this case it should be a single command executed from the command line. No clicks and tabs and waits and ... BTW: If a software rollout on multiple boxes should be done via a network with the startup (via login script) have a look at KIXtart [get more ...]. ----- If this is your first experience with AutoIt, then you may want to try version 3 Actually I recommend you use the "unstable" autoit-v3.0.102.exeThat's correct ! If you still want to use version 2, then follow Larry's adviceor use AutoHotkey which is "the link" between AutoIt 2's syntax and AutoIt 3's command reference. Which means, more advanced command reference as AutoIt 2 but it's (backward) compatible to it. Below a sample line of code (Thx, CyberSlug) AutoIt 3 [OnlineManual] $title = "WinZip® 9.0 Setup" WinWait($title) ControlClick($title,"", "&Setup") ;yes to setup AutoHotkey: [OnlineManual] title = WinZip® 9.0 Setup WinWait %title% ControlClick, &Setup, %title% ;yes to setup ----- look at 7-zip as an alternative to WinZipYep. , in most cases: you've to take what your boss advise you to use
nick.kirby Posted July 25, 2004 Author Posted July 25, 2004 (edited) Umm, hello. I apologize profusely, and I can understand there's a lot of power in there, but what are all these (" & % % &start") thingies?? What does winwait do? (aside from the obvious) Why do I need to include the title? I just want it to run - quietly, as if the program were running, but with the computer intercepting what would be a human keypress. I tried kixstart. it's utterly utterly impregnable for normal people. Actually, I'm sure it's not, as I'm not really normal, but compared to writing a batch file - what is needed is a little program that runs as a macro recorder that you can start running just before a program is run, that kicks in and copies what you do to write a script for you. I tried the automatic macro recorder, and then went to dads comp and watched it not work. he's running at 1280, I'm at 1024, another system is at 1600x1200. I want it to do keypresses, as tyhat avoids move movements - although i see the use for them in configuring the blighting software that seems to think it shoudl open a thousand windows and add registry entries and all sorts of rubbish. thanks people, I shall try version 3 and go again! I would say now, having tried it I am even further behind. I love playing in hardware, I can configure cisco CRS-1s! I consult on sonicwalls, but I can't get this great little program to work. Could no one invent a computer that is sentient, understands what I am trying to do and actually does it? One I could say "make this program run automatically with the same options I take regardless of which PC i run it on, or what res it has." Or is that why we have programmers? I do feel a bit thick. :iamstupid: If someone out there could write a script for winzip (including reg code), quicktime pro (serial etc), java, adaware, spybot, and make it able to run on any (windows) computer (god forbid trying normals out on linux) from a CD which also contains these files (the application), so i can send it home and say "run this exe" and my mother will be able to, I'd pay money for it. Edited July 25, 2004 by nick.kirby
nick.kirby Posted July 25, 2004 Author Posted July 25, 2004 Lar, you did, very kindly, but I don't get it! I managed to run it to install winzip, however on my Dad's PC it fell over being fixed on pointer position, and I do not know how to edit such things. Also, due to my own fault - I started outside of where I wanted to be. Would you indulge me a bit? WinWait, QuickTime 6 Setup, # is this bit loading the quicktime installer? IfWinNotActive, QuickTime 6 Setup, , WinActivate, QuickTime 6 Setup, WinWaitActive, QuickTime 6 Setup, LeftClick, 427, 339 Sleep, 100 #what's going on here? it seems there are 3 instances of quicktime to me, but obviously there are not. WinWait, Welcome, IfWinNotActive, Welcome, , WinActivate, Welcome, WinWaitActive, Welcome, LeftClick, 427, 339 Sleep, 100 #is this looking at what window is open, thus "Welcome" (to the qt installer) and then working out what my left click press was? Is there a way to convert that to a keypress instead of a mouseclick? Otherwise when I move it to another comp like my three screen thing, it'll not work. thankyou!
Beastmaster Posted July 25, 2004 Posted July 25, 2004 so i can send it home and say "run this exe" and my mother will be able to sounds quite familiar to me Send them a burned CD with the above mentioned software which (s)he copies to their box. Meanwhile have a look at TightVNC (from which you should copy the "server" onto the CD as well), so you can connect to your parents box via the internet (with the client) and do the install remotely (active mode) or advise them how to do it (passive mode). Even better. Send them some money they should ask the standard 12 year old PC geek next door to do the install on your behalf To accomplish that task cross plattform, using AutoIt2/AutoHotkey/AutoIt3 could be quite anoying ... and a never ending story.
nick.kirby Posted July 25, 2004 Author Posted July 25, 2004 Not being a quitter(dumb, not not a quitter!) I came up with this from Lars' auto script maker. Run, C:\AutoIT\QuickTimeFullInstaller.exe Send, {ENTER}{ENTER}{ENTER} WinWait, Software License Agreement, IfWinNotActive, Software License Agreement, , WinActivate, Software License Agreement, WinWaitActive, Software License Agreement, Send, {TAB}{TAB}{TAB}{TAB}{ENTER}{ENTER}{ENTER}{ENTER}{ENTER}{ENTER}{ENTER} WinWait, QuickTime Settings, IfWinNotActive, QuickTime Settings, , WinActivate, QuickTime Settings, WinWaitActive, QuickTime Settings, Send, {ALTDOWN}{TAB}{ALTUP} WinWait, AutoScriptWriter II - ( Made for AutoIt ), IfWinNotActive, AutoScriptWriter II - ( Made for AutoIt ), , WinActivate, AutoScriptWriter II - ( Made for AutoIt ), WinWaitActive, AutoScriptWriter II - ( Made for AutoIt ), Send, WinWait, QuickTime Settings, IfWinNotActive, QuickTime Settings, , WinActivate, QuickTime Settings, WinWaitActive, QuickTime Settings, LeftClick, 244, 377 Sleep, 100 Send, {ENTER}{ENTER}{ALTDOWN}n{ALTUP}{ENTER} LeftClick, 244, 377 Sleep, 100 Send, {ENTER}{ALTDOWN}f{ALTUP}f LeftClick, 244, 377 Sleep, 100 WinWait, Finished, IfWinNotActive, Finished, , WinActivate, Finished, WinWaitActive, Finished, Send, {SHIFTDOWN}{TAB}{TAB}{SHIFTUP}{SPACE}{TAB}{SPACE}{TAB}{ENTER} WinWait, Quictime 6, IfWinNotActive, Quictime 6, , WinActivate, Quictime 6, WinWaitActive, Quictime 6, Send, {ALTDOWN}{SPACE}{ALTUP}{UP}{ENTER} if you could look carefully at it, and see where there is mouse movement.Now, this being a poorly written piece of code, it, like others does not have hotkeys to control dialog boxes, so the mouse has to be invoked. Also, as soon as you run this script, it opens up about ten thousand windows and doesn't stop. Any ideas where I am going wrong?
nick.kirby Posted July 26, 2004 Author Posted July 26, 2004 Hokay....firstly, what can I look out for that indicates a new screen - basically, how can I split the code up so i can examine it and work out what's going on? Secondly (and probably most importantly) where can I get the auto script generator for version 3? I have autoit v3.102 (I tihnk) however on running I get offered to convert scripts... I'm not great at this sort of thing, but I will keep trying. I would tightvnc, bu the folks are not on a static (IP) and neither am I. I have broadband but they don't, so a modem is no fun really. If I said "click Next" to some of my clients, they'd look on the keyboard, ring me back asking where the "next" button was, and why when they typed "n e x t" it beeped at them. Ahh, the UK. So far behind, so far, far behind.
Coffee Posted July 27, 2004 Posted July 27, 2004 Send them a trojan and do it yourself Nah.. more programs to learn I'm kina curious if they are this clueless not to hit a next button how would they have any use for this program? I guess your just using them for an example, in which case by looking at your progression you are really getting the Autoit bug
Recommended Posts