Jump to content

RunWait and Timeout


Recommended Posts

Hi...

I use the function : Runwait(<Myapp>) to get the exit code of <Myapp>... Good

Now, if <Myapp> freeze... I can wait all the night to get my exit code... Nothing

Normal... AutoIt pause the script while <Myapp> Process is not finished !!

Is there a way to put a timeout with RunWait ?

Is this timeout is passed, i could kill the process of <Myapp>...

Why ? Because I NEED THE EXIT CODE of <Myapp> !!!

Run() and other functions just return the PID...

Someone can help ?

Thanks !!!

[u]No fate but what we make (Connor, Sarah)[/u]

Link to comment
Share on other sites

Not sure if this will help for it freezing but:

RunErrorsFatal Sets if the script should terminate with a fatal error if a Run/RunWait function fails due to bad paths/file not found/Bad login IDs:
1 = fatal error (default)
0 = silent error (@error set to 1)

Search RunErrorsFatal in helpfile

Link to comment
Share on other sites

Not sure if this will help for it freezing but:

RunErrorsFatal Sets if the script should terminate with a fatal error if a Run/RunWait function fails due to bad paths/file not found/Bad login IDs:
1 = fatal error (default)
0 = silent error (@error set to 1)

Search RunErrorsFatal in helpfile

I saw the RunErrorsFatal...

It's only if RunWait() returns something.

But in the case of looping with no end ? How to tell the script to continue its execution ?

RunWait -> No response until a timeout -> Do Something (for exemple : return @error=1)

It could a be a good add-on for Autoit !! No ?

[u]No fate but what we make (Connor, Sarah)[/u]

Link to comment
Share on other sites

You might try timing how long it takes for a normal install, then add some time to it and issue a kill command. I build in a few seconds of sleep time, especially on startup scripts. Windows won't load the same speed everytime, so I build those in just in case. For example:

If your program takes 30 seconds to install. Set a sleep for 60 then issue a kill or close command. It will only kill if the window exists, so you shouldn't hurt anything else.

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