Followers 0

# Super-Nerb here!

## 21 posts in this topic

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!

#### Share this post

##### Share on other sites

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)

#### Share this post

##### Share on other sites

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

#### Share this post

##### Share on other sites

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.

#### Share this post

##### Share on other sites

#5 ·  Posted (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 by Rad

#### Share this post

##### Share on other sites

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!

#### Share this post

##### Share on other sites

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

#### Share this post

##### Share on other sites

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?

#### Share this post

##### Share on other sites

#9 ·  Posted (edited)

ControlSend("Program Installer","", ***, "C:\Program Files\MyProgram") ;Install dir

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 etc

And 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 by Rad

#### Share this post

##### Share on other sites

#10 ·  Posted (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 by J_Kay

#### Share this post

##### Share on other sites

(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

#### Share this post

##### Share on other sites

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 etc

And 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.

#### Share this post

##### Share on other sites

(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

That'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!

#### Share this post

##### Share on other sites

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.

#### Share this post

##### Share on other sites

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!

#### Share this post

##### Share on other sites

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.

#### Share this post

##### Share on other sites

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?

#### Share this post

##### Share on other sites

#18 ·  Posted (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 by J_Kay

#### Share this post

##### Share on other sites

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.

#### Share this post

##### Share on other sites

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.

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