We had some frustrating moments where we got the error about missing icons, so I decided to dig into it.
Below are my findings… basically adding extra information to Andrew Niefer's answer.
For Windows, the process of replacing the images in the native launcher is described below. The processing is done by p2 class: org.eclipse.pde.internal.swt.tools.IconExe
This class looks at the resources of native launcher and notes the bitmaps that are in there: their sizes and their color depth.
Then it looks at the provided images. This can be a list of separate BPMs or an ICO file containing multiple BMPs. Their sizes and color depths are also noted.
This only works when all provided images are uncompressed. When one or more of the images is compressed, the process stops and no bitmaps are replaced in the native launcher.
Next it tries to match the provided BMP sizes and color depths to the ones in the native launcher and where they match, they are replaced in the native launcher.
When one or more bitmaps in the native launcher are not available in the provided images, the following message is written to System.err:
Error - <n> icon(s) not replaced in […]using […]
The class IconExe has a main method and can be run as stand-alone. Its first argument is the native launcher that needs to be modified and the following arguments are the provided BPM or ICO files.
For Eclipse 4.3(.x), the native launcher contains 7 bitmaps:
- 256x256, 32 bit (RGB / Alpha Channel)
- 48x48, 32 bit (RGB / Alpha Channel)
- 32x32, 32 bit (RGB / Alpha Channel)
- 16x16, 32 bit (RGB / Alpha Channel)
- 48x48, 8 bit (256 colors)
- 32x32, 8 bit (256 colors)
- 16x16, 8 bit (256 colors)
So, for the process of replacing the images to be successful, 7 images with the same size and depth need to be provided, either as separate BMPs or inside an ICO.
However, when using the tycho-p2-publisher-plugin, you cannot provide 7 separate BPMs, since the tycho-p2-publisher-plugin is not aware of the 256x256x32 image when it is specified in the .product file.
Its class org.eclipse.tycho.model.Launcher only reads the other 6 image locations from the .product file and hence, the 7th image (the 256x256x32 one) is skipped.
Therefore, the list that IconExe gets is one image short and will always report:
Error - 1 icon(s) not replaced in […]using […]
The solution that worked for us was to combine the 7 BMPs into one ICO file and provide that in the .product file.
But note that some image manipulation applications, that can create ICO files, tend to compress the 256x256x32 image by default. This is what got us on the wrong foot!
So be careful that all images in the ICO file are uncompressed.