Jump to content

Autoit Error Message Box


Recommended Posts

What can be done to have an Autoit production exe to crash silently?

It will be useful instead of such Autoit Error Message box that scares workstations user to store on a shared network drive a log file with the error description. The log file name should be the workstation name followed by a date-time index.

After compilation with the latest Autoit Beta (3.1.165) this exe works fine in my workstation but fails at some point with Autoit Error Message in other workstations. Im using it to update silently in background other applications and the users dont feel comfortable with these mysterious messages.

Why it fails in another workstation than mine is probably a matter of operating system compatibility or missing dll. This problem appears if using #include "SysTray_UDF.au3", which I use to clean-up useless icons in the system tray.

Link to comment
Share on other sites

What can be done to have an Autoit production exe to crash silently?

It depends mainly on the type of errors you're receiving and the lines of code causing them. Could you please share some example error messages and possibly your code?
Link to comment
Share on other sites

It depends mainly on the type of errors you're receiving and the lines of code causing them. Could you please share some example error messages and possibly your code?

<{POST_SNAPBACK}>

The problem appears when calling _SysTrayIconRemove(_SysTrayIconIndex($st_process)) and the error message refers to some array suff in Line 0.

The first line is #include "SysTray_UDF.au3", added recently in a file that otherwise works for years.

I run successfully all the code in my file that terminates with something like this before Autoit error pop-ups:

loadClickYes() ; load clickyes.exe

Sleep(2000)

$st_process = "ClickYes.exe"

_SysTrayIconRemove(_SysTrayIconIndex($st_process)) ; HERE I GOT THE ERROR

If @error Then Exit

Exit

Edited by crosu
Link to comment
Share on other sites

try opt ("runerrorsfatal",0)

<{POST_SNAPBACK}>

AutoItSetOption("RunErrorsFatal",0) is there, I'm using Func OnAutoItExit() and Func OnAutoItStart() but can't find anything to specifficaly enable/disable an Autoit Error Message box. RunErrorsFatal refers to bad file path or bad login IDs and my problem is in Line 0 (#include "SysTray_UDF.au3") for certain worksations. Everything works fine in my laptop. Edited by crosu
Link to comment
Share on other sites

AutoItSetOption("RunErrorsFatal",0) is there, I'm using Func OnAutoItExit() and Func OnAutoItStart() but can't find anything to specifficaly enable/disable an Autoit Error Message box. RunErrorsFatal refers to bad file path or bad login IDs and my problem is in Line 0 (#include "SysTray_UDF.au3") for certain worksations. Everything works fine in my laptop.

<{POST_SNAPBACK}>

You right, no posibility to suppress the Fatal error message except for run
Link to comment
Share on other sites

You right, no posibility to suppress the Fatal error message except for run

<{POST_SNAPBACK}>

Autoit is a great tool for automation but given the variety of systems and workstation configurations I think that a silent crash option for any Autoit Error is needed. The best is to save debug info in a log file to avoid scaring users with unfamiliar pop-ups for them.
Link to comment
Share on other sites

Autoit is a great tool for automation but given the variety of systems and workstation configurations I think that a silent crash option for any Autoit Error is needed. The best is to save debug info in a log file to avoid scaring users with unfamiliar pop-ups for them.

<{POST_SNAPBACK}>

Hello? Common sense? If you don't want fatal errors, don't write bad code. Error handling is your responsibility. If you don't want to write proper error handling, then don't complain to us about your script crashing with a message box. This is like banging your head against the wall and then telling people your head hurts. If you don't want it to happen, do something about it.
Link to comment
Share on other sites

Hello?  Common sense?  If you don't want fatal errors, don't write bad code.  Error handling is your responsibility.  If you don't want to write proper error handling, then don't complain to us about your script crashing with a message box.  This is like banging your head against the wall and then telling people your head hurts.  If you don't want it to happen, do something about it.

<{POST_SNAPBACK}>

I'm afraid is not about bad code. As a matter of fact the code works fine since Autoit version 2 with hundreds of updates in tens of automation applications.

The problem is that:

1. I included recently this Systray UDF made available for download by its author Tuape

2. I compiled with the latest Autoit BETA version without any error

3. The production exe works fine in my laptop and other workstations (no errors)

4. The production exe fails on other workstations (not all of them)

5. I wanted a method to learn and solve the issue without involving the user. The user reports that the main application works fine except a mysterious message, possible virus.

6. If such method is not implemented, no problem, like always Ill find a solution

7. Your political speech is yet another reason to continue using Autoit

Link to comment
Share on other sites

I'm afraid is not about bad code. As a matter of fact the code works fine since Autoit version 2 with hundreds of updates in tens of automation applications.

All errors in AutoIt with the sole exception of the system running out of memory can be avoided by proper coding. If you are getting any message for any reason that is not directly related to AutoIt running out of memory (Which you won't get unless you are trying), then the solution is to write better code. Even if the code is not yours, which from the sound of your problem, it may not be your code. Never-the-less, it is your responsibility to either contact the author of the code so that they can fix the code; fix it yourself and demonstrate the problem and fix to the author of the code; fix it and leave the author to fend for himself. There is absolutely no reason

Let me point out the things you've done incorrectly so far in getting a resolution:

  • You tell us there is an error and only give a vague indication of what the error might be.
  • You mention repeatedly that you are using an include file called "SysTray_UDF.au3" but don't tell us where to get it or what it does. Only by careful reading do we see that tuape is the author.
  • You did not contact the author or post your problems with specific information in a location where the author is likely to see it.
  • You suggest changing the behavior of AutoIt in a way that is contradictory to good coding practice.
I suggest you do one or more of the following to get your problems resolved:
  • Contact the author of the code directly about the problem. Finding the forum post where you found the file is probably the best way to contact them so the entire community can participate if they so desire.
  • Give more information about the error. Copy and paste the error (Ctrl+C works in Windows 2000 and later to copy text from a message box).
  • Try to show what code causes the error to occur (How you are using the code).
If you do even half of these things, you'll give somebody enough information to help you. Otherwise, you're wasting a lot of people's time including your own since you're giving nothing but vague hints directed at the wrong people.
Link to comment
Share on other sites

All errors in AutoIt with the sole exception of the system running out of memory can be avoided by proper coding ...

<{POST_SNAPBACK}>

To put a closure to this subject, the problem is apparently solved:

1. in my au3 file I used AutoItSetOption("MustDeclareVars",1) and I declared all variables as Global

2. while the #include "SysTray_UDF.au3" file had no "MustDeclareVars" statement (only locals variables).

3. In the end I added AutoItSetOption("MustDeclareVars",1) in the included SysTray file

4. I determined via SyntaxCheckBeta (SCITE) what variables are not declared and I made them Global.

At least on my home network the file works fine now on Windows XP and Windows Server 2003 (no more errors) I still have to verify on Windows 2000 at work.

In my world time means money and I cannot afford speeches from lessons learned database and ISO XXXXXX spec instructions for solving problems. In my world first I solve the problem, then I make the rules, and then the rules are too old and useless to face new challenges.

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