warcrow Posted October 25, 2006 Share Posted October 25, 2006 I DL the latest verison of Autoit. Wow. It's much more complicated than I thought. I'm not a programming guy, so this is a little imtimidating -but I'm not giving up! :"> So, here is my scenario: I want to automate the installation of a pretty big application (20 mins of patching and running executables, registration info). I want to have autoit basically install as much of this application as possible. Can someone point me toward the tutorials or walkthrough that would be applicable to this? I've gone through the Autoit 1-2-3 (posted here in the forums) and I was getting errors messages throughout it, looking for a beta or something. But, despite that, it doesnt look to cover anything I need to install, click buttons, and enter information in text boxes. Help. Thanks in advanced guys! Link to comment Share on other sites More sharing options...
Rad Posted October 25, 2006 Share Posted October 25, 2006 Alright you could start with what needs to be installed. Files/folders/registry keys etc... Then how do you want it to be autmoated? Do you want to create start menu shortcuts etc. Do you want it like the installshield where it prompts for all that? (Everything you say yes to makes it more difficult to program, but its all possible)Have you opened the helpfile yet? You should also download beta here:http://www.autoitscript.com/autoit3/files/beta/autoit/(Download autoit-v3.2.1.11-beta-setup.exe, or the .zip, put it in *\beta) Link to comment Share on other sites More sharing options...
rbhkamal Posted October 25, 2006 Share Posted October 25, 2006 Search the help file for "winzip" They automated the winzip setup. RK "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 Alright you could start with what needs to be installed. Files/folders/registry keys etc... Then how do you want it to be autmoated? Do you want to create start menu shortcuts etc. Do you want it like the installshield where it prompts for all that? (Everything you say yes to makes it more difficult to program, but its all possible)Have you opened the helpfile yet? You should also download beta here:http://www.autoitscript.com/autoit3/files/beta/autoit/(Download autoit-v3.2.1.11-beta-setup.exe, or the .zip, put it in *\beta)I was hoping to have the automation run the installation executable for this program, then click on the "next buttons", then input the registration key, fill in the user reg name, ect. Then, run the patches (.exe's), after that. I just need a more profecient batch file I guess.As far as shotcuts and menu shortcuts, I'm pretty sure thats all handled by the installation of the actual application. Link to comment Share on other sites More sharing options...
Rad Posted October 25, 2006 Share Posted October 25, 2006 (edited) Oh i see thats much easier lol! Im not very good at running the files, people here know all the extensions and options you will need... but you could start of with Run("C:\installer.exe") WinWaitActive("Program Installer","") ControlClick("Program Installer","", ***) ;next button Etc, something like that Edited October 25, 2006 by Rad Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 Oh i see thats much easier lol! Im not very good at running the files, people here know all the extensions and options you will need... but you could start of with Run("C:\installer.exe") WinWaitActive("Program Installer","") ControlClick("Program Installer","", ***) ;next button Etc, something like that THAT IS AWESOME! That's exactly what I need! Now, how do I test this to make sure it's working so far. So impressed, thanks so far for your help! Link to comment Share on other sites More sharing options...
Rad Posted October 25, 2006 Share Posted October 25, 2006 Well, you should have SciTE in your autoit folder which is what you write the code with (normally, notepad does work though) Save your file as YourName.au3 (in scite), then press F5 (Or Tools > Go (f5) / Tools > Beta Run (alt+f5)) Not sure what it was on the Beta Run hotkey, but its the same thing just not Beta SciTE It will probrably give you some errors... they are easy to fix 95% of the time, just share what they are if you cant figure it out Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 THAT IS AWESOME! That's exactly what I need! Now, how do I test this to make sure it's working so far. So impressed, thanks so far for your help! OMG! I've tested what I've done so far and it works! This program is awesome! ...How do you "input information"? As in, if I want to input some registration numbers and such into a feild? Link to comment Share on other sites More sharing options...
Rad Posted October 25, 2006 Share Posted October 25, 2006 (edited) ControlSend("Program Installer","", ***, "C:\Program Files\MyProgram") ;Install dirIn your start menu navigate to your au3 folder and open the helpfile (paper with a big yellow question mark...)Now on the left theres a few tabs. Click on Search or Index and type "ControlSend"Sends a string of characters to a control.ControlSend ( "title", "text", controlID, "string")Is that what you wanted?The quote was where you would put the install directory, it would be the same for the start directory etcAnd if your putting in a CD key you could just simulate input, with Send("{KEY}"), Mix this with a loop to find out what the letter was that rubbed off on your cd case (i did this for diablo 2, it was awesome) Edited October 25, 2006 by Rad Link to comment Share on other sites More sharing options...
J_Kay Posted October 25, 2006 Share Posted October 25, 2006 (edited) I have written a script that automates the installation of 6 programs, and a couple of standalone programs. In my experience, using ControlSend works most of the time. If it doesn't, revert to the Send command. But be careful, anytime I automate an install, I always block input with BlockInput(1) then at the end release the block with BlockInput(0). This way a stray mouse click, or a weird windows popup doesn't foul your script. Best of luck. *EDIT - Fixed grammar error. Edited October 25, 2006 by J_Kay Link to comment Share on other sites More sharing options...
Rad Posted October 25, 2006 Share Posted October 25, 2006 (I wouldnt put blockinput in until its ready and working properly... ) You could use the beta MouseTrap() to lock the mouse, then just remove focus from the controls, so that you cant accidentally mess it up.. block input would be better, but in fear of it giving an error that might not be a good idea Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 In your start menu navigate to your au3 folder and open the helpfile (paper with a big yellow question mark...)Now on the left theres a few tabs. Click on Search or Index and type "ControlSend"Sends a string of characters to a control.ControlSend ( "title", "text", controlID, "string")Is that what you wanted?The quote was where you would put the install directory, it would be the same for the start directory etcAnd if your putting in a CD key you could just simulate input, with Send("{KEY}"), Mix this with a loop to find out what the letter was that rubbed off on your cd case (i did this for diablo 2, it was awesome)I'm sure this will be very useful, thanks a ton Rad -seriously. You've made this so easy for me, it's really appreciated in a business environment. Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 (I wouldnt put blockinput in until its ready and working properly... )You could use the beta MouseTrap() to lock the mouse, then just remove focus from the controls, so that you cant accidentally mess it up.. block input would be better, but in fear of it giving an error that might not be a good ideaThat's a great idea. I was wondering if there was some kind of work around. I like the idea of trying to avoid use interaction that might screw up the install. But completely locking any input would mean trouble if an error occurs -forceing a reboot.I like your idea! Link to comment Share on other sites More sharing options...
J_Kay Posted October 25, 2006 Share Posted October 25, 2006 You don't have to reboot. If the script stops, or hangs, just hit CTRL-ALT-DEL then click the Cancel button on the WIndows XP screen and it releases the block. THen you can stop the script. I use it all the time. Just allows me to rule out mouse clicks and stuff during the running of the script. Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 You don't have to reboot. If the script stops, or hangs, just hit CTRL-ALT-DEL then click the Cancel button on the WIndows XP screen and it releases the block. THen you can stop the script. I use it all the time. Just allows me to rule out mouse clicks and stuff during the running of the script.Oh nice! Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 Oh nice! Bummer. I've run into a bump in the road.In the middle of an installation, it just stops at one window. I've checked to make sure the "program name" (or window) is correct and that the button id is correct. Nothing seems to work. I rebooted my machine just for grin -nada.Anyone have any troubleshooting suggestions? I'm not sure what is going on. Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 screenshot and example script... also describe what you expected to happen. Lar. Excellent suggestion, here is everything I can tell ya: Run("C:\ArcGIS_9\ArcGIS_Install\setup.exe") WinWaitActive("ArcView Setup","") ControlClick("ArcView Setup", "", 293);next button WinWaitActive("ArcView Setup", "") ControlClick("ArcView Setup", "", 309);radial Button "I agree" ControlClick("ArcView Setup", "", 293);next button WinWaitActive("ArcView Setup", "") ControlClick("ArcView Setup", "", 749);radial typical Install ControlClick("ArcView Setup", "", 293);next button WinWaitActive("ArcView Setup", "") ControlClick("ArcView Setup", "", 293);next button Thats the code. Here is a screenshot: What I'm expect to happen is for autoit to click on the next button. The window before this is the type of install. As you can see from the code, I've selected "typical isntall", which is raidal button 749. That window and correct buttons is fine. I have a "winwaitactive" set, but maybe thats not the right command? Is there another type of wait? Link to comment Share on other sites More sharing options...
J_Kay Posted October 25, 2006 Share Posted October 25, 2006 (edited) I've had this happen from time to time. Make sure you spelled the title and text correctly. Proper case and puncuation and spacing. It's tripped me up a few times. If things are correct, I'll throw a msg box in between lines of code to see where its getting before it stops. Add in this line Msgbox(0, "", "") Place it before your ControlSend statement, if a msgbox pops up. You know you're making it that far. If it doesn't then your problem lies before it. It helps me pinpoint what line is not working correctly. *************************************************** Sorry, I was typing the above as you posted. Try this: ControlSend("ArcView Setup", "Destination Folder", 293, "!n") That line sends an Alt-N to that control which should activate the Next button. Edited October 25, 2006 by J_Kay Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 I've had this happen from time to time. Make sure you spelled the title and text correctly. Proper case and puncuation and spacing. It's tripped me up a few times. If things are correct, I'll throw a msg box in between lines of code to see where its getting before it stops. Add in this line Msgbox(0, "", "")Place it before your ControlSend statement, if a msgbox pops up. You know you're making it that far. If it doesn't then your problem lies before it. It helps me pinpoint what line is not working correctly.***************************************************Sorry, I was typing the above as you posted. Try this:ControlSend("ArcView Setup", "Destination Folder", 293, "!n")That line sends an Alt-N to that control which should activate the Next button.Hrm, not working. I tried using (bolded) what you put above, and that didnt do it. I put the msg box popup code in right before the line and it did pop up, but the next button isnt gettg hit. Link to comment Share on other sites More sharing options...
warcrow Posted October 25, 2006 Author Share Posted October 25, 2006 Hrm, not working. I tried using (bolded) what you put above, and that didnt do it. I put the msg box popup code in right before the line and it did pop up, but the next button isnt gettg hit. HA!i deleted, saved, and cut& pasted everything back in and it worked. 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