Sign in to follow this  
Followers 0
Azraelsub7

/ErrorStdOut ON without RUN

10 posts in this topic

Can a compiled script start with ErrorStdOut feature ?

I know it can be done using Run , but in my case that will produce two instances , and i do not want that .

I even tried something like this :

Func _OnAutoitEnter()
If $CmdLine[$CmdLine[0]] = 0 Then
MsgBox (0 , 0 , $CmdLine[$CmdLine[0]])
Run (@AutoItExe & ' /ErrorStdOut "ContinueTrue"',@ScriptDir,0,6)
Exit
EndIf
EndFunc

but the exit after Run doesn't work , i thought i can use multithreading but i know autoit doesn't support that , and i really don't want to start two process , i think the dev's should include a opt(ErrorStdOut) cause is very needed , a simple search over the forum and anyone will find hundreds of threads looking for a way to suppress the " ugly " error message box .

People look for a way to have a customizable error in case of a fatal error , and i think autoit should provide that , and i assume isn't very hard to add a option for how fatal error should be handled .

Thanks in advance .

azrael-sub7 .

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

People look for a way to have a customizable error in case of a fatal error , and i think autoit should provide that , and i assume isn't very hard to add a option for how fatal error should be handled .

A hard error is exactly what it says => hard and cannot be recovered.

When you mean Autoit3 errors like "Array variable has incorrect number of subscripts or subscript dimension range exceeded.:" then its simply a matter of proper programming and checks. If you want the modify the error then indeed simply wrap your compiled program but that does mean you run 2 programs when submitting it:

1. the wrapper shelling and checking the script

2. the actual script shelled with the /ErrorStdOut parameter

COM errors can be handled fine as mentioned.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I know that if i code a script well , i will never get errors like " variable not defined " and other fatal errors , but again someone could unpack my compiled script then modify it somehow and then the ugly msbox will appear for sure .

I don't have a coding problem i just want to be 100% that the message box is suppressed .

And i don't understand why is there anyway ? For me is a security issue , someone could better understand how to exploit disassemble and modify the compiled script .

And i didn't implied that the compiled exe must run after the error cause that is very stupid to think , i was searching for a method to not show the error , a swiftly and silent exit .

I know there are other msbox that can appear if i mangle the compiled script , like " Script not found " , but i guess that aren't a big problem cause i don't expect people to mangle an compiled script in such a way .

So i would like to hear , a solution , if is possible other than what i already mentioned , if is planned to be added or something like that .

@Jos

Yeah , i know all that and running like you said is unacceptable for me , as i told in first post .

Edited by Azraelsub7

Share this post


Link to post
Share on other sites

but again someone could unpack my compiled script then modify it somehow and then the ugly msbox will appear for sure .

...

For me is a security issue , someone could better understand how to exploit disassemble and modify the compiled script .

This does not make sense to me. If someone is able to decompile your script, he can remove all the code you added to hide the errors.

Also you are not responsible for someone altering your script. You should only care about errors occuring with your own code.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Using Run() CAN'T be a problem. If you have one, then tell us so we can say what you're doing wrong.

I really don't want to use run , i just tried using it like this :

Someone executes the compiled script ->

-> compiled script checks if the last command line argument is 0

-> if it is run another instance of the program it self with command line arguments , then exits .

The problem with this is that EXIT command form the script is ignored , so it will open " infinite " instances of the self program .

But i tried this because i didn't find a way to start the compiled script with the /ErrorStdOut already set , the only method i found was using two process , and i said that i can not accept that .

Now my goal is to have a compiled script that will never show message boxes with fatal error messages even if someone will mangle that script , so i do not have a problem with a script command , i just want to know if someone could help me finding a way ( other then run 2 exe`s ) that assures me no one will ever see that message box , no matter what happens .

@ProgAndy

Yeah you right but a compiled script executed form command prompt with the parameter /ErrorStdOut will not show any error , so i would like that a compiled script do that without the /ErrorStdOut .

In any case , i didn't mention a decompile , i was thinking someone could do a tiny alter to my compiled script and then the message box will appear .

@All

I found some way but is messy , after i compile a script , with ollydbg , i will search the call to messagebox and then i just nup those instructions , it works but i must make this steps for any script that i compile . And i don't know if is allowed to modify the way interpreter is working , anyway i look forward to other solutions .

I still don't know why there is not a option to show or not that messagebox , cause is so easy to code 3-4 lines of code is all what it takes something like this : if ( opt['showfatalerror'] ) { // ugli msg box } ...

Edited by Azraelsub7

Share this post


Link to post
Share on other sites

Why are you starting "infinite instances"? Start 1. And Exit works fine.

If $CmdLine[0] = 0 Then
    Run(@AutoItExe & " /ErrorStdOut Pizza")
    Exit
EndIf

MsgBox(0, "", "Before crash")

MsgBoxer()

There, run that and see.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

@AdmiralAlkex

Thanks a lot , i guess i didn't checked the parameters for run very well anyway , this method is only a partial solution if you think , this running and exit isn't a very good way , it will still load interpreter and script twice , for performance is better to alter the way interpreter works , and it would be better if in next version someone will come with a nice idea to add this feature especially when is so easy to code it .

Thanks .

Edited by Azraelsub7

Share this post


Link to post
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
Sign in to follow this  
Followers 0