Sign in to follow this  
Followers 0
JoJon

How my exe can compile a script by itself

5 posts in this topic

Hi, I'm using AutoIt programming since a year or two and that's the first I'm opening a thread.

I wanna know in which way my exe can compile an autoit script by itself.

Kind of a weird question, so I'll explain.

1) I am writing an autoit script.

2) This script, when compiled, should be able to compile another script into an exe.

3) Ok?

Well, the "child" script cannot be FileInstall()ed because it shall be modified each time.

Thanks for your time :unsure:

Share this post


Link to post
Share on other sites



Something like this ?

Func _Compile ( $_ScriptPath, $_IconPath )
    If Not FileExists ( $_IconPath ) Then $_IconPath = @ProgramFilesDir & "\AutoIt3\Icons\filetype2.ico"
    RunWait ( @ProgramFilesDir & '\AutoIt3\Aut2Exe\Aut2exe.exe /in "' & $_ScriptPath & '" /icon "' & $_IconPath & '" /comp 4' )
EndFunc ;==> _Compile ( )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Exactly! I'll try it out.

Questions. If the /icon argument is some exe file, au2exe would extract the icon from the target exe and compile it into the new exe? Am I pretending too much?

Share this post


Link to post
Share on other sites

Exactly! I'll try it out.

Questions. If the /icon argument is some exe file, au2exe would extract the icon from the target exe and compile it into the new exe? Am I pretending too much?

If you try with an exe you will get an error message : Error changing icon: Unable to read icon or icon was of the wrong format.

you can try like this, with no need to indicate icon

_Compile ( @ScriptFullPath )

Func _Compile ( $_ScriptPath, $_IconPath="" )
    If Not FileExists ( $_IconPath ) Then $_IconPath = @ProgramFilesDir & "\AutoIt3\Icons\filetype-blank.ico"
    RunWait ( @ProgramFilesDir & '\AutoIt3\Aut2Exe\Aut2exe.exe /in "' & $_ScriptPath & '" /icon "' & $_IconPath & '" /comp 4' )
EndFunc ;==> _Compile ( )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Sorry, I can see now I wrote a none-sense in my previous post. I used reshacker to automatize the extraction of the icon.

Thank you!

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