Adding image to an exe

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
vardan1245
Posts: 6
Joined: 01 Jul 2022, 05:33

Adding image to an exe

Post by vardan1245 » 03 Jul 2022, 12:18

Hi!
I've a script that''s using an image for ImageSearch.
How can I convert ahk to exe and include that image in exe (not a standalone file).
Thanks

User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Adding image to an exe

Post by boiler » 03 Jul 2022, 12:21


vardan1245
Posts: 6
Joined: 01 Jul 2022, 05:33

Re: Adding image to an exe

Post by vardan1245 » 03 Jul 2022, 12:36

I'm adding this code to the end of the script. Maybe something is wrong ? it's not working

FileInstall, IMAGE.PNG, C:\Users\user\Desktop\New folderv2\test_exe.exe, 1

Thank you

User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: Adding image to an exe

Post by boiler » 03 Jul 2022, 12:40

The destination is not your exe file. It’s not a file at all. It’s the directory where you want the file to be installed, which can be a relative path.

User avatar
pervect66
Posts: 27
Joined: 09 Jun 2021, 06:53

Re: Adding image to an exe

Post by pervect66 » 05 Jul 2022, 02:26

So do you want to include it in your executable without extracting when it is started?

;@Ahk2Exe-AddResource logo.bmp, LOGO1

If you want it extracted when the executable starts:

FileInstall, logo.bmp, %logo%, 0

A bit more context when asking a question goes a long way, and will get (better) answers.

Post Reply

Return to “Ask for Help (v1)”