Jump to content

How my exe can compile a script by itself


 Share

Recommended Posts

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:

Link to comment
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

Link to comment
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

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