Icons in executables

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Icons in executables

drtau
What is the recommended procedure or tool to use to add an
icon for a deployed executable?  The icon would appear in the
title bar of the windows of the application, and beside the filename
when viewed in the Windows file explorer.  Thanks.


Reply | Threaded
Open this post in threaded view
|

Re: Icons in executables

Ian Bartholomew-4
Rodney,

> What is the recommended procedure or tool to use to add an
> icon for a deployed executable?

Don't know about recommended, but the following should work.

>                       The icon would appear in the
> title bar of the windows of the application,

There are a couple of ways of doing this.

1) Create a 32x32 icon in a file then use the ViewComposer to set the
#largeIcon aspect of your main Shell resource to point at the icon file. You
can also create a 16x16 icon and do the same for the #smallIcon aspect but I
am not sure if this is necessary?

2) Add a _class_ method to your Shell presenter

icon
    ^##(self) instanceClass defaultIcon

"or"

icon
    ^YourShellClassName defaultIcon

Both are equivalent. The first is the way the rest of the image implements
it but the second is more explanatory. You then have to provide a 32x32 icon
file _with the same name as your class_. In the above you would therefore
name the file "YourShellClassName.ico"

This method may also have some issues relating to the location of the icon
file. Putting it in the same folder as the executable or Dolphin image (for
development) is a good bet. If you see a little question mark symbol where
the icon should appear then you know you've got it wrong.

The other advantage (?) of this method is that all the Dolphin development
browsers will also use your icon.

> and beside the filename
> when viewed in the Windows file explorer.  Thanks.

This has been mentioned before in the group (see the archive) and there are
some external applications that will allow you to do this. However, if you
don't mind "quick and dirty" my ImageEditor should also work. You have to
use the Editor to create 4 icons

32x32 using 16 colours or less
16x16 using 16 colours or less
32x32 using 256 colours or less
16x16 using 256 colours or less

You then tell the Image Editor to save the 4 icons into an _existing_ exe
file (that _must_ be a Dolphin generated executable file).  It's a bit
"naughty" as I use the fact that the stub Dolphin executable file has 4
icons, with the above format, in a fixed position. I just overwrite that
part of the exe with the new icons and, as long as they are the same format,
nothing should be harmed.

The documentation for the ImageEditor is, to put it politely, absolutely
appalling (one day....) so get back to me for more information if you decide
to go this way and can't work out how to use it.

Regards
    Ian


Reply | Threaded
Open this post in threaded view
|

Re: Icons in executables

drtau
Thanks for you help Ian.

Ian Bartholomew wrote:

> Rodney,
>
> > What is the recommended procedure or tool to use to add an
> > icon for a deployed executable?
>
> Don't know about recommended, but the following should work.
>
> >                       The icon would appear in the
> > title bar of the windows of the application,
>
> There are a couple of ways of doing this.
>
> 1) Create a 32x32 icon in a file then use the ViewComposer to set the
> #largeIcon aspect of your main Shell resource to point at the icon file. You
> can also create a 16x16 icon and do the same for the #smallIcon aspect but I
> am not sure if this is necessary?
>
> 2) Add a _class_ method to your Shell presenter
>
> icon
>     ^##(self) instanceClass defaultIcon
>
> "or"
>
> icon
>     ^YourShellClassName defaultIcon
>
> Both are equivalent. The first is the way the rest of the image implements
> it but the second is more explanatory. You then have to provide a 32x32 icon
> file _with the same name as your class_. In the above you would therefore
> name the file "YourShellClassName.ico"
>
> This method may also have some issues relating to the location of the icon
> file. Putting it in the same folder as the executable or Dolphin image (for
> development) is a good bet. If you see a little question mark symbol where
> the icon should appear then you know you've got it wrong.
>
> The other advantage (?) of this method is that all the Dolphin development
> browsers will also use your icon.
>
> > and beside the filename
> > when viewed in the Windows file explorer.  Thanks.
>
> This has been mentioned before in the group (see the archive) and there are
> some external applications that will allow you to do this. However, if you
> don't mind "quick and dirty" my ImageEditor should also work. You have to
> use the Editor to create 4 icons
>
> 32x32 using 16 colours or less
> 16x16 using 16 colours or less
> 32x32 using 256 colours or less
> 16x16 using 256 colours or less
>
> You then tell the Image Editor to save the 4 icons into an _existing_ exe
> file (that _must_ be a Dolphin generated executable file).  It's a bit
> "naughty" as I use the fact that the stub Dolphin executable file has 4
> icons, with the above format, in a fixed position. I just overwrite that
> part of the exe with the new icons and, as long as they are the same format,
> nothing should be harmed.
>
> The documentation for the ImageEditor is, to put it politely, absolutely
> appalling (one day....) so get back to me for more information if you decide
> to go this way and can't work out how to use it.
>
> Regards
>     Ian