Jump to content

Best Way To Script Installations


Recommended Posts

Hello,

I am looking for some direction in the best way to setup an autoit script that will aitomate the installation of certain applications.

The way that the documentation has it is through a winwaitactive for each window that keystrokes need to be sent to.

The issue with that is that sometimes installers do different things based upon the current computer's configuration. so the

waiitwindowactive waits for a window but that window does not come up right away because the installer brings up a different window first and the Autoit script will fail.

It would be great if there was some sort of a function that allows waitwindow with multiple possiblilities and if it is window 1 do window 1 routine if it is window 2 do window 2 routine etc.

I am thinking that an alternative to the previous wish should be that the better process should be

- Wait window change to occur

- make sure that the new window is active for a short while and is waiting for input (by this I mean that it isn't just a work window that the installer puts up for a few seconds until it is ready for input from the user)

- determine the active window and go to the approriate routine.

I know that this is longwinded but I hope my question of the best way to script installations is clear.

Steven

Link to comment
Share on other sites

I like my installs to be more deterministic than that. I will have tested in the target environment and should know exactly what window(s) will come up. Where there are alternate possibilities, it is easy to script:

$NextTitle = "Widgets 1.0 Installer"
$NextText = "Click on Next to continue"
$NagTitle = "Nagvertisement"
$NagText = "Don't forget to buy WidgetsToolsPro!"

; Hit Alt-n for next - sometimes a nag screen pops up first...
While 1
    If WinExists($NextTitle, $NextText) Then
        WinActivate($NextTitle, $NextText)
        WinWaitActive($NextTitle, $NextText)
        Send("!n") ; Next
        ExitLoop
    ElseIf WinExists($NagTitle, $NagText) Then
        WinClose($NagTitle, $NagText)
    EndIf
    Sleep(100)
Wend

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

lod3n,

Very Interesting,

So you constantly loop looking for a window that exists in your list of possible windows, send the input to it and only resume the loop when that window no longer exists.

Also, it seems that you are not concerned about the order that you are searching for the different windows defined.

What I am looking to do is setup some sort of a generic process that can be used to install multiple applications instead of creating a script for each individual application.

This generic script would initially load the windows to search for and relevant information from a control file specifically defined for each application.

Any comments or feelings about this approach? I am new at this and would appreciate advice and feedback.

Steven

Link to comment
Share on other sites

PsaltyDS,

I understand that you want to code it exactly how it will work in that environment. My question is that I don't have the luxury to do that given what my business is does and would an autoit script generic installer work sufficiently well using a different method.

Steven

Link to comment
Share on other sites

PsaltyDS,

I understand that you want to code it exactly how it will work in that environment. My question is that I don't have the luxury to do that given what my business is does and would an autoit script generic installer work sufficiently well using a different method.

Steven

There is only one catch and that is Catch-22:

You want to code a script so it will work in all target environments.

The only way you'll know if it works is to test in those environments.

While you test in those environments, you'll learn what to compensate for where it doesn't work.

You could simplify the script and your life by skipping all that planning and testing.

But then you won't ever know if it works in those environments.

PsaltyDS was moved very deeply by the absolute simplicity of this clause of Catch-22 and let out a respectful whistle.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...