JoJon Posted April 25, 2011 Share Posted April 25, 2011 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 Link to comment Share on other sites More sharing options...
wakillon Posted April 25, 2011 Share Posted April 25, 2011 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.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JoJon Posted April 25, 2011 Author Share Posted April 25, 2011 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? Link to comment Share on other sites More sharing options...
wakillon Posted April 26, 2011 Share Posted April 26, 2011 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.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JoJon Posted April 27, 2011 Author Share Posted April 27, 2011 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now