Jump to content

Try to automate install


Recommended Posts

First Autoit script. :)

I'm trying to automate a an install which should be very simple, it only has one screen to click "Next" and another for "Finish. The package was built with LANDesk Package Builder.

I used http://www.autoitscript.com/autoit3/docs/t...nzip/winzip.htm as a guide.

Run (".\CrystalMaker.exe")
 
WinWaitActive ("CrystalMaker", "Emory CrystalMaker 2.05")
Send ("!n")
 
WinWaitActive ("CrystalMaker", "CrystalMaker installed")
Send ("{ENTER}")

When I run the script, the exe launches but the "Next" button does not get clicked which should be a alt+n keystroke. I have attached a screen shot.

Posted Image

Using the AutoIt Window info app, the title is CrystalMaker if I have my cursor over the background, but there's no title show if I have my cursor over the dialog box.

If I run the script from a "built" script that contains the crystalmaker.exe, a bunch of crystalmaker.exe processes spawn and you see dozens of autoit icons in the system tray.

What am I doing wrong?

Thanks.

Link to comment
Share on other sites

...Using the AutoIt Window info app, the title is CrystalMaker if I have my cursor over the background, but there's no title show if I have my cursor over the dialog box...

Welcome to the forum.

Legacy99 may have solved your problem for this one script by suggesting a silent install and Zedna is correct in pointing you towards AutoIt's line of "Control" functions for greater reliability; however, let's deal with your script as written.

If you will add this line...

AutoItSetOption("TrayIconDebug", 1) ;0-off

...to the very top of your script

then run your script

then place your mouse over the AutoIt icon in the system tray by the clock

a tooltip should tell you the line that your AutoIt script is hung up on.

I'm going to guess that your script nevers gets to the Send ("!n") line because it never found a window to satisfy this line WinWaitActive ("CrystalMaker", "Emory CrystalMaker 2.05")

Like you mentioned, there is no title to the dialog box.

It is ok to use code like...

WinWaitActive ("", "Emory CrystalMaker 2.05")

So, assuming that the install app does not put a title on the second dialog box, you can try this code.

AutoItSetOption("TrayIconDebug", 1) ;0-off

Run(".\CrystalMaker.exe")

WinWaitActive("", "Emory CrystalMaker 2.05")
Send("!n")

WinWaitActive("", "CrystalMaker installed")
Send("{ENTER}")

...enjoy AutoIt and this great forum community...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Thank you so much for the quick replies. I found the problem. I named both the autoit script and my exe the same thing, CrystalMaker.exe and so the script kept launching itself. :);)

My main goal was to make it silent so I did the /An option. I tried that before I tried AutoIt, but the exe was on a network share and didn't work.

Thanks for the help. I look forward to learning AutoIt.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...