AutoHotkey Community

It is currently May 27th, 2012, 10:25 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: February 8th, 2005, 2:16 am 
Offline

Joined: February 8th, 2005, 12:16 am
Posts: 4
Location: Vienna/AUSTRIA
hello everybody,

could the compiler include the icons which are mentioned in a script, so that they are within the *.exe file and there is no more the need to deliver the icons with the program directory or else they are no found (and an error-mesage popup...?

would be nice to pass a single exe file to friends and dont worry where the icons are ...

thank you for thinking about....

...sorry for my weak english ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2005, 2:40 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
You could put all your icons inside the script compiler folder so you don't have to worry about file/folder renaming and other sorts of problems.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2005, 3:14 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
FileInstall is a command specifically made for including files in compiled scripts, but it might not be exactly what you're looking for.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2005, 9:57 am 
Offline

Joined: February 7th, 2005, 11:11 am
Posts: 192
Location: Munich, Germany
I wrote a DOS-batch for the program icon which is in the upper-left in each window. I put the icon to the .ahk-file and compile it with

Ahk2exe.exe /in MyScript.ahk /out MyScript.exe /icon MyIcon.ico

"MyIcon.ico" is the one. Within the script you don't need anything special. After compilation any icon is yours even in the tray.

Peter


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2005, 2:34 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Those are all great suggestions.

I believe you can explicitly include extra icons of your own in a compiled script by following these steps:

1) Decompress the compiled script with UPX:
upx -d MyScript.exe

2) Use ResHacker or similar to add more icons to the script (attach them directly to the EXE).

3) Recompress the script with UPX:
upx --best --compress-icons=0 MyScript.exe

After doing that, have the script access its own icons directly by number:
Menu, Tray, Icon, %A_ScriptFullPath%, 10 ; Replace 10 with the right icon number.

Quote:
could the compiler include the icons which are mentioned in a script, so that they are within the *.exe file
It's a good idea and I will add it to the to-do list.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2005, 12:33 pm 
Offline

Joined: February 8th, 2005, 12:16 am
Posts: 4
Location: Vienna/AUSTRIA
thank you all for your help...

I have tried out the workaround mentioned by Chris but unfortunally I got an short error messege when startet the new,recompressed script: "Could not open the script inside the EXE." :roll:

think for me maybe it will be the best waiting that the "include personal icons in comiled script" - function will come in one of the next versions of AHK ;) ;)

till then I´ll pass my *.exe files together with used icons in a folder in a *.zip (or selfextracting-zip) to my friends - not that elegant but it´s a way...;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2005, 6:34 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Thanks for trying. I tried it too and have the same problem without even adding any icons. Apparently, using "upx -d" directly on a compiled script changes it in a way that prevents it from launching.

As a last resort, I'm pretty sure you can add the icons directly to AutoHotkeySC.bin. That way, every compiled script should wind up with extra icons, which can then be loaded using the method described above.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2011, 9:13 am 
Offline

Joined: August 30th, 2010, 9:05 pm
Posts: 21
More than 6 years passed and ahk2exe still can add only one icon to the executable. Has anyone found a good method to add more icons to executable made by ahk2exe?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2011, 8:06 pm 
Offline
User avatar

Joined: February 28th, 2011, 7:28 pm
Posts: 625
Location: Germany
Compile_AHK can do that.

_________________
RECOMMENDED: AutoHotkey_L
Image
github - ImportTypeLib
Win7 HP SP1 32bit | AHK_L U 32bit


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2011, 11:58 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
AutoHotkey_L v1.1.01.00
Lexikos wrote:
Side note: It is now feasible for Ahk2Exe to be rewritten as a script.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2011, 12:26 am 
Offline

Joined: August 30th, 2010, 9:05 pm
Posts: 21
maul.esel wrote:
Compile_AHK can do that.

Many thanks :)

@jaco0646 So we are waiting for new versions :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2011, 3:20 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
The current version of Ahk2Exe is a script maintained by fincs.
http://www.autohotkey.com/forum/topic74816.html
https://github.com/fincs/Ahk2Exe


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2011, 8:51 am 
Online
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
Sinel1980 wrote:
maul.esel wrote:
Compile_AHK can do that.

Many thanks :)

@jaco0646 So we are waiting for new versions :)


If new versions included ways to embed media files (there are methods to do this, without extracting them afaik) I would be delighted. Else I'll just learn the fancy .dll-thingey.

_________________
~sumon Appifyer AHK Nova halted Recommended: AHK_L (Why?)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 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