Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a way to permantly replace the default .ico with a custome one?
#1
I've been playing with making icons, and would like to replace the current built-in QB64-PE icon with another so all the .EXE's will have mine embedded instead of the one that came with QB64-PE.  Is there a way to do that?  I tried overwriting the qb64pe.ico in the source folders with mine but the generated EXE's still have the old one.

Here's an image from one of the icons I'm trying to use.  I'm using IcoFXPortable to make my .ico files.

   

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#2
(10-12-2023, 05:59 PM)Dav Wrote: I tried overwriting the qb64pe.ico in the source folders with mine but the generated EXE's still have the old one.

This ICO file you're trying to replace, is the full path?
Code: (Select All)
(qb64folder)/internal/temp/icon.ico

For EXE file already created then you will have to find the source code for them and recompile with the new ICO. At least on Windows `_ICON` and $EXEICON were supposed to work. On Linux most of the time I get the generic "X-dot-org" icon.

Now I don't remember how to deal with the "dot-rc" file but you might have to modify "recompile-win.bat" to force the inclusion of the customized icon.
Reply
#3
Here's how I'd go about doing this:

1) Get a copy of the repo itself -- NOT the already compiled Windows/Linux Builds.  (https://github.com/QB64-Phoenix-Edition/...s/main.zip )  <-- This should be the link/file you're looking for, for the current, most up to date version.

2) Instead of having QB64PE.EXE already built, you'll need to build your own EXE with the "setup_win.cmd".  (Or lnx, or mac, as per the OS you're installing on.)  Take note of the relevant file, but DON'T build your version yet.

3) Instead, go into "internal/source/" and replace the "icon.ico" there with the icon you generated.  It's easiest if you just name yours "icon.ico" and overwrite the old one.  That way you won't have to alter the .rc file or anything else.

4) Now go back to the root directory for where you extracted QB64PE, and run the proper install script for you OS.  You'll build QB64PE from scratch, and it'll find your file instead of our current icon, and use it for QB64PE.

After that, you'll done and just run the built QB64PE.EXE like usual, with the icon you provided in place of the one we ship by default.  Smile
Reply
#4
(10-12-2023, 05:59 PM)Dav Wrote: I've been playing with making icons, and would like to replace the current built-in QB64-PE icon with another so all the .EXE's will have mine embedded instead of the one that came with QB64-PE.  Is there a way to do that?  I tried overwriting the qb64pe.ico in the source folders with mine but the generated EXE's still have the old one.
This hasn't been clarified to you, but QB64-PE does not supply _any_ icon to built EXE's unless the program specifies one. The icon you're likely seeing is simply the default Windows icon it displays when a program lacks an icon. Thus there's no icon file you can overwrite to change it because QB64-PE simply isn't including an icon at all.

The easiest solution is to add `$EXEICON:''` to all your source files. The other option would be making modifications to QB64-PE itself to include an icon into programs that don't request one.
Reply
#5
Hmm, thank you all for the very quick replies/advice.  Great community here!

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#6
Easiest way,

1.) rename your qb64pe.exe to org-qb64.exe
2.) run org-qb64.exe
3.) load source\qb64pe.bas
4.) change the $EXEICON line (line 13) to your icon (with path if required)
5.) press F11 to rebuild qb64pe.exe with the new icon
6.) quit the IDE and delete the org-qb64.exe

To get all your programs using your icon just place the same $EXEICON line in your programs. That's in fact the only logic way, as all the icon.ico stuff as mentioned above is just what you placed in the $EXEICON line and then temporarily used during the current build.

Without $EXEICON or manually loading an image and pass it to _ICON your programs will always use the hardcoded image in libqb.cpp, which is in fact the same as the current PE icon.
Reply
#7
(10-12-2023, 05:59 PM)Dav Wrote: I've been playing with making icons, and would like to replace the current built-in QB64-PE icon with another so all the .EXE's will have mine embedded instead of the one that came with QB64-PE.  Is there a way to do that?  I tried overwriting the qb64pe.ico in the source folders with mine but the generated EXE's still have the old one.

Here's an image from one of the icons I'm trying to use.  I'm using IcoFXPortable to make my .ico files.



- Dav

Nice!  I like how you more subtly incorporated the flaming bird.  Here's another one in the same vein...

   
Reply
#8
(10-12-2023, 07:27 PM)dbox Wrote:
(10-12-2023, 05:59 PM)Dav Wrote: I've been playing with making icons, and would like to replace the current built-in QB64-PE icon with another so all the .EXE's will have mine embedded instead of the one that came with QB64-PE.  Is there a way to do that?  I tried overwriting the qb64pe.ico in the source folders with mine but the generated EXE's still have the old one.

Here's an image from one of the icons I'm trying to use.  I'm using IcoFXPortable to make my .ico files.



- Dav

Nice!  I like how you more subtly incorporated the flaming bird.  Here's another one in the same vein...
Sweet!
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#9
Thanks, RhoSigma for the steps.  

dbox, I like the looks of that. 

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#10
(10-12-2023, 07:27 PM)dbox Wrote:
(10-12-2023, 05:59 PM)Dav Wrote: I've been playing with making icons, and would like to replace the current built-in QB64-PE icon with another so all the .EXE's will have mine embedded instead of the one that came with QB64-PE.  Is there a way to do that?  I tried overwriting the qb64pe.ico in the source folders with mine but the generated EXE's still have the old one.

Here's an image from one of the icons I'm trying to use.  I'm using IcoFXPortable to make my .ico files.



- Dav

Nice!  I like how you more subtly incorporated the flaming bird.  Here's another one in the same vein...

That Q is Apple's Swift logo.  Tongue
Reply




Users browsing this thread: 2 Guest(s)