AutoHotkey Community

It is currently May 27th, 2012, 9:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: November 22nd, 2006, 8:29 am 
Offline

Joined: August 24th, 2005, 5:29 pm
Posts: 549
Location: Berlin / Germany
This thread is continued at

:arrow: http://www.autohotkey.com/forum/viewtopic.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.com/forum/viewtopic.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:

Image

Image

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 http://www.autohotkey.net/~dwuttke/Compile/Compile_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 http://www.autohotkey.net/~dwuttke/Compile/Compile_AHK_Setup.ahk.

If you prefer to do it on your own, download the script fom at http://www.autohotkey.net/~dwuttke/Compile/Compile_AHK.ahk. After this you need GoRC.exe and the ResHacker.exe from http://www.autohotkey.com/forum/post-77121.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! :D

_________________
nick :wink:


Last edited by nick on September 11th, 2007, 2:49 pm, edited 4 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2006, 8:49 am 
Offline

Joined: November 21st, 2006, 9:00 pm
Posts: 210
I get a "command line parameter error" when loading it.

It says : Wrong number of parameters : 0


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2006, 9:02 am 
Offline

Joined: August 24th, 2005, 5:29 pm
Posts: 549
Location: Berlin / Germany
ecksphore wrote:
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?

_________________
nick :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2006, 8:49 am 
Offline

Joined: November 21st, 2006, 9:00 pm
Posts: 210
I didn't get any GUI at all .. just that error message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2006, 9:16 am 
Offline

Joined: August 24th, 2005, 5:29 pm
Posts: 549
Location: Berlin / Germany
I wasn't at home the last two days so I couldn't answer.
Quote:
Wrong number of parameters : 0

means, that there is no (zero) command line parameter.

So I have to ask again: How do you start the Comple_AHK.exe?

_________________
nick :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 30th, 2007, 8:04 am 
Offline

Joined: December 29th, 2006, 6:57 am
Posts: 123
Location: Australia
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

?

_________________
(The guy from Oz)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2007, 8:55 pm 
Offline

Joined: January 19th, 2007, 9:09 pm
Posts: 147
i try to use it, but i get the same error as nick... can you help us??


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2007, 11:23 am 
Offline

Joined: August 24th, 2005, 5:29 pm
Posts: 549
Location: Berlin / Germany
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?

:?:

_________________
nick :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2007, 6:12 am 
Offline

Joined: December 29th, 2006, 6:57 am
Posts: 123
Location: Australia
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

_________________
(The guy from Oz)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2007, 6:50 am 
Offline

Joined: December 7th, 2005, 8:29 am
Posts: 345
same here i get a GoRC.exe related error... :(


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2007, 4:09 pm 
Offline

Joined: August 24th, 2005, 5:29 pm
Posts: 549
Location: Berlin / Germany
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!

_________________
nick :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2007, 12:25 am 
Offline

Joined: September 10th, 2006, 1:41 pm
Posts: 157
Hi nick

your compiler supports just first icon change... not like AHKIconChanger...?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2007, 3:30 pm 
Offline

Joined: August 24th, 2005, 5:29 pm
Posts: 549
Location: Berlin / Germany
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.

_________________
nick :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2007, 4:18 pm 
Offline

Joined: October 28th, 2006, 2:14 am
Posts: 297
Location: US
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?

_________________
Changed siggy at request of ahklerner :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2007, 7:35 am 
Offline

Joined: August 24th, 2005, 5:29 pm
Posts: 549
Location: Berlin / Germany
Elevator_Hazard wrote:
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?

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.

_________________
nick :wink:


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], sks and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group