Sign in to follow this  
Followers 0
AL3X

--

8 posts in this topic

#1 ·  Posted (edited)

--

Edited by AL3X

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It's easy. The compiled AutoiT-Exe has the full Au3-compiler in it.

If the Parameter /AutoIt3ExecuteScript is given, it doesn't run the internal Script, but the Script given by CMDline :D

/ErrorStdOut redirects the Error-Out to StdOut.

;Compile this :)
$file = FileOpenDialog("Select Au3 to run",@DesktopDir,"Au3 (*.au3)| all (*.*)")
If @error Then Exit MsgBox(0,"Error","No file chosen")
Run('"' & @AutoItExe & '" /ErrorStdOut /AutoIt3ExecuteScript "' & $file &'"')
Edited by ProgAndy

*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

Hi, can somebody give me a simple example of how can I run a script from a compiled .exe ?

I already saw the help file

Form 3: Compiled.exe /ErrorStdOut /AutoIt3ExecuteScript file

but i dont understand it...

Thanks :D

AutoIt is an interpreted scripting language. That means the script is just a text file that does nothing until it is interpreted by... you guessed it... the interpreter.

When you "compile" and AutoIt script, you are just packing together the binary interpreter, and your script text (there is some compression/encryption too). So the finished .exe file contains the full AutoIt interpreter and your full script text.

Since the interpreter is packed inside the compiled .exe file of any script, it can be used to run/interpret another uncompiled script .au3 file. If you create a script called ScriptOne.au3, then compile it as ScriptOne.exe, you can just run your script by simply running ScriptOne.exe your command line. Very straight forward.

Now let's say you wrote another script called ScriptTwo.au3, but never compiled it. You can run the uncompiled script using the interpreter that was packed into the compiled script using the following command line:

C:\Temp\ScriptOne.exe /ErrorStdOut /AutoIt3ExecuteScript C:\Temp\ScriptTwo.au3

Because of the "/AutoIt3ExecuteScript" command line switch, the script packed into ScriptOne.exe never actually runs. The interpreter packed inside ScriptOne.exe is instead used to execute the script text in ScriptTwo.au3.

Hope that helps.

:D


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

Share this post


Link to post
Share on other sites

I think, the ScriptOne mutn't be packed with UPX. At least, this didn't work foe me.


*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

#5 ·  Posted (edited)

--

Edited by AL3X

Share this post


Link to post
Share on other sites

If it should be external, you have to use FileInstall


*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)

--

Edited by AL3X

Share this post


Link to post
Share on other sites

thank you very much for this help.... I was looking for this for a long time and got it while searching for another post. :graduated:

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