Sign in to follow this  
Followers 0
insignia96

Compiling a .au3 from within a script.

12 posts in this topic

The name is kinda self-explanatory, can i have it so script1 (standalone .exe) Lets the user set some stuff, then compiles a temporary script file (generated by script1) to an exe, that being a standalone too. All hell apprciated!

Regards,

Insignia96


Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower

Share this post


Link to post
Share on other sites



The name is kinda self-explanatory, can i have it so script1 (standalone .exe) Lets the user set some stuff, then compiles a temporary script file (generated by script1) to an exe, that being a standalone too. All hell apprciated!

Regards,

Insignia96

You didn't mention whether you could have Aut2EXE packaged along..

If you could have script1.exe and Aut2exe.exe, .. then your tempscript.au3 could be compiled to tempscript.exe. You'll just need to write a wrapper around script1.exe to use aut2exe to compile your temp script. If you don't want to make it very evident, you could probably rename aut2exe to something else .. rename it to exe just as you compile the temp script and later rename it back

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You can use command line switches for Aut2Exe.

They can be found in the helpfile under:

AutoIt -> Using AutoIt -> Compiling Scripts -> Method 3 - The Command Line

Keep in mind a copy of Aut2Exe and (maybe) some other files will need to be included with your application.

You compiled exe can also execute other scripts and lines. Look in the helpfile under:

AutoIt -> Using AutoIt -> Command Line Parameters -> AutoIt specific command Line Switches

Most of it is self explainitory. I also seem to remember a UDF made by a past forum user. Give the example scripts forum a quick search.... :D

You didn't mention whether you could have Aut2EXE packaged along..

If you could have script1.exe and Aut2exe.exe, .. then your tempscript.au3 could be compiled to tempscript.exe. You'll just need to write a wrapper around script1.exe to use aut2exe to compile your temp script. If you don't want to make it very evident, you could probably rename aut2exe to something else .. rename it to exe just as you compile the temp script and later rename it back

FileInstall could also be another option, as all you need to do is install it to a Temp folder, compile using the mention parameters, and walla... compiled exe! :D

Cheers,

Brett

Edited by BrettF

Share this post


Link to post
Share on other sites

You didn't mention whether you could have Aut2EXE packaged along..

If you could have script1.exe and Aut2exe.exe, .. then your tempscript.au3 could be compiled to tempscript.exe. You'll just need to write a wrapper around script1.exe to use aut2exe to compile your temp script. If you don't want to make it very evident, you could probably rename aut2exe to something else .. rename it to exe just as you compile the temp script and later rename it back

You don't have to package anything along with the compiled script.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Is it possible to do like ProgAndy uses in his MySQL UDF and have like a Aut2Exeexe.au3 and Autoitwrapperexe.au3 and then extract them to the temp dir when in use? Then on script exit i could delete them. Feasible?


Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower

Share this post


Link to post
Share on other sites

Is it possible to do like ProgAndy uses in his MySQL UDF and have like a Aut2Exeexe.au3 and Autoitwrapperexe.au3 and then extract them to the temp dir when in use? Then on script exit i could delete them. Feasible?

Yes but remember, you were talking Compiled scripts earlier and now you are talking about a plain script. That would mean that you had to include autoit3.exe to run the script.

Best to Compile the scripts and then read up on FileInstall() in the help file.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Yes but remember, you were talking Compiled scripts earlier and now you are talking about a plain script. That would mean that you had to include autoit3.exe to run the script.

Best to Compile the scripts and then read up on FileInstall() in the help file.

We must remember too that compiled scripts can run .au3 scripts, so using AutoIt3.exe is not 100% necessary.

Usage should be as follows (if memory serves me correct)

MyCompileAutoItScript.exe /AutoIt3ExecuteScript "D:\this_is_another_script.au3"

Cheers,

Brett

Edited by BrettF

Share this post


Link to post
Share on other sites

The program i am writing is a program to generate a launcher for a game. It lets you set some stuff then fills in some blanks in a template script and compiles it. I want both scripts to look standalone. I want all dependencies like aut2exe and AutoIt3Wrapper to be somehow embedded in the .exe for script 1. Script 2 (the generated script) doesn't need anything else.


Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

If i used this would it work:

FileInstall( "C:\Program Files\AutoIt3\Aut2Exe\Aut2exe.exe", @TempDir )
FileInstall( "C:\Program Files\AutoIt3\SCiTE\AutoIt3Wrapper\AutoIt3Wrapper.exe", @TempDir )
Edited by insignia96

Visit my website to see all my finished releases!Releases here:UDFs:GUI ResizingColor List (Web Colors)GUIFade_NearestPower

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