This thread is continued at
:arrow: http://www.autohotke...pic.php?t=22975
THX, ladiko and good luck!
Update on 2007-06-24:
Removed buggy version check for /NoDecompile
Update on 2007-03-24:
Support for AHK's 1.0.46.10 new compiler parameter /NoDecompile
Update on 2007-02-17:
Fixed bug on paths containing spaces
This thread was originally posted in the German Forum at http://de.autohotkey...topic.php?t=771. AGU was so kind to translate it, so it can be posted in the mother of forums now:
When I started to use AHK and AU3 I chose AU3 as my primary scripting language because I liked the syntax, the SciTe integration and some additional integrated functions which make your life easier. Then I had an AU3 tool which barely ran on my own Athlon 2600+ but had a response time of several seconds on the Celeron600 PCs at work in my company. So I started the difficult task and ported it to AHK and guess what - it ran like a charm even on those old machines. Since that time I used AU3 very rarely.
My tools/programs are always distributed as compiled Exe. That's why I always missed the AU3 option 'Compile with Options'. Additionally I recently discovered Thalons AHK Icon Changer and thought, if you want to have it, write it on your own. So I asked Thalon for permission to use his code and wrote the 'Compile_AHK' script:
What is it good for?
Compile_AHK handles all compiler options and version information within the script's own directory in a file named Scriptname.ahk.ini. Set once, they will be read out on every run, displayed and can finally be change at wish. After settings are done once all that changes during compiling is the displaying of the GUI and the need to press 'Return' one more time.
What do you need?
Download the Compile_AHK_Setup.exe from https://ahknet.autoh...e_AHK_Setup.zip. The setup includes Compile_AHK.exe, GoRC.exe and ResHacker.exe. They will be installed into your 'Compiler' subfolder of your Autohotkey installation folder. I chose that way instead of copying the files somewhere else and checking the paths by reading the registry every time of execution. Additionally the action "Compile with Option" can be added to the AHK files context menu for calling Compile_AHK easy. If you want to have a look before, you can find the Compile_AHK_Setup.ahk script at https://ahknet.autoh...e_AHK_Setup.ahk.
If you prefer to do it on your own, download the script fom at https://ahknet.autoh...Compile_AHK.ahk. After this you need GoRC.exe and the ResHacker.exe from http://www.autohotke...7121.html#77121. ResHacker.exe can be packed with UPX.exe --best Reshacker.exe if you like. After that you have to compile Compile_AHK.ahk. Copy Compile_AHK.exe, GoRC.exe and ResHacker.exe in your 'Compiler' subfolder of your Autohotkey installation folder.
Finally you may switch the calling of Ahk2Exe from within the editors to Compile_AHK.exe. Please pay attention that only /in parameter and the full script path will be passed over.
How does it work?
At first start and on every version change, the file AutoHotkeySC.bin will be saved within the 'Compiler' subfolder as AutoHotkeySC.bin.org. In order to enter the version information it will be recreated from the backup copy. After compiling it will be restored again.
Compiler options will be passed to Ahk2Exe.exe as commandline parameters if possible. Compression will be achieved by setting the registry value HKCU\Software\AutoHotkey\Ahk2Exe\LastCompression. Because Ahk2Exe automatically uses the LastIcon entry for the icon, it will be deleted before and after calling the GUI.
If "Set Version Info" is selected, the version info values are added temporary to AutoHotkeySC.bin by calling GoRC.exe and ResHacker.exe before compilation.
For the Run Before/After calls you may use the placeholders %IF%, %OF%, %OD% and %ON%. Before execution they will be replaced as:
%IF% = script file's full path, %OF% = exe file's full path, %OD% = exe file's directory, %ON% = exe file's name.
So give it a try! I hope, you'll like it!
Compile_AHK - for those who compile!
Started by
nick
, Nov 22 2006 07:29 AM
17 replies to this topic
I get a "command line parameter error" when loading it.
It says : Wrong number of parameters : 0
It says : Wrong number of parameters : 0
#2
-
Posted 22 November 2006 - 07:49 AM
I get a "command line parameter error" when loading it.
It says : Wrong number of parameters : 0
You can't use it on its own without the command line parameters /in scriptfile_full_path.
Did you try the "Compile with Options" context menu entry?
#3
-
Posted 22 November 2006 - 08:02 AM
nick :wink:
I didn't get any GUI at all .. just that error message.
#4
-
Posted 23 November 2006 - 07:49 AM
I wasn't at home the last two days so I couldn't answer.
So I have to ask again: How do you start the Comple_AHK.exe?
means, that there is no (zero) command line parameter.Wrong number of parameters : 0
So I have to ask again: How do you start the Comple_AHK.exe?
#5
-
Posted 25 November 2006 - 08:16 AM
nick :wink:
I like your program and when trying to compile using other options
just selecting the script file plus an icon file
when I compile I get compilation error
am I missing something. I like how it is a hard stay on top and easy gui.
love to get it to work.
It created Prog.ahk.ini
OUT_FILE=E:\Monitor\Prog.exe
OUT_ICON=
UPX_LEVEL=2
OUT_PASS=
RUN_BEFORE=
RUN_AFTER=
[VERSION]
VERSION_INFO=0
But no new exe
?
just selecting the script file plus an icon file
when I compile I get compilation error
am I missing something. I like how it is a hard stay on top and easy gui.
love to get it to work.
It created Prog.ahk.ini
OUT_FILE=E:\Monitor\Prog.exe
OUT_ICON=
UPX_LEVEL=2
OUT_PASS=
RUN_BEFORE=
RUN_AFTER=
[VERSION]
VERSION_INFO=0
But no new exe
?
#6
-
Posted 30 January 2007 - 07:04 AM
(The guy from Oz)
i try to use it, but i get the same error as nick... can you help us??
#7
-
Posted 03 February 2007 - 07:55 PM
Sorry, but a can't reproduce the error.
So, what\how did you install where?
How do you start the Compile_AHK.exe?
Are there any additional messages in Compile_AHK.log in AHK's Compiler directory?
:?:
So, what\how did you install where?
How do you start the Compile_AHK.exe?
Are there any additional messages in Compile_AHK.log in AHK's Compiler directory?
:?:
#8
-
Posted 04 February 2007 - 10:23 AM
nick :wink:
I downloaded the file and accepted the standard installation. I right click on a ahk file and choose compile with options and get the compiler error message.
Using ahk2exe.exe I do not have a problem
Using ahk2exe.exe I do not have a problem
#9
-
Posted 05 February 2007 - 05:12 AM
(The guy from Oz)
Sorry, I'm just on the way into holidays without any internet connection. I'll come back on 2007-02-15 and will try to find out, what's wrong!
So long!
So long!
#11
-
Posted 05 February 2007 - 03:09 PM
nick :wink:
Hi nick
your compiler supports just first icon change... not like AHKIconChanger...?
your compiler supports just first icon change... not like AHKIconChanger...?
#12
-
Posted 16 February 2007 - 11:25 PM
Hi,
it should be done. Seems to be the everlasting problem with path names containing spaces. In german versions of windows "Program files" is called "Programme", no space at all. But I wonder, why it wasn't noticed earlier.
I updated Compile_AHK_Setup.zip and Compile_AHK.ahk script. So give it a try!
@DJAnonimo:
Compile_Ahk is a wrapper for Ahk2Exe with additional support for version informations. The icon file is passed to Ahk2Exe and Ahk2Exe accepts only one. I know the AHK Icon Changer and parts of the script are taken from it. But I think that using Compile_AHK is a little bit easier.
it should be done. Seems to be the everlasting problem with path names containing spaces. In german versions of windows "Program files" is called "Programme", no space at all. But I wonder, why it wasn't noticed earlier.
I updated Compile_AHK_Setup.zip and Compile_AHK.ahk script. So give it a try!
@DJAnonimo:
Compile_Ahk is a wrapper for Ahk2Exe with additional support for version informations. The icon file is passed to Ahk2Exe and Ahk2Exe accepts only one. I know the AHK Icon Changer and parts of the script are taken from it. But I think that using Compile_AHK is a little bit easier.
#13
-
Posted 17 February 2007 - 02:30 PM
nick :wink:
For that icon does it use A_WorkingDir if it finds a relation in paths? that's what I need, or does it store it some other way?
#14
-
Posted 17 February 2007 - 03:18 PM
Changed siggy at request of ahklerner
The icon file may be stored anywhere. Once selected within the gui, it's path is stored in scriptname.ahk.ini in the script's folder.For that icon does it use A_WorkingDir if it finds a relation in paths? that's what I need, or does it store it some other way?
#15
-
Posted 18 February 2007 - 06:35 AM
nick :wink: