replaceIcons
public static java.util.Collection<IconExe.IconResInfo> replaceIcons(java.io.File launcherFile,
org.eclipse.pde.internal.swt.tools.IconExe.ImageData[] icons,
java.util.function.Consumer<java.lang.String> errorMessageConsumer)
throws java.io.FileNotFoundException,
java.io.IOException
Replace the Desktop icons provided in the Windows executable program
with icons provided by the user.
Note 1. Write access to the executable program is required. As a result, that
program must not be currently running or edited elsewhere.
Note 2. Use loadIcons to determine which set of icons (width, height, depth)
is required to replace the icons in the executable program. A user icon
matching exactly the width/height/depth of an executable icon will be written
to the executable and will replace that executable icon. If an executable icon
does not match a user icon, it is left as is. Verify the return value matches
the number of icons to write. Finally, use loadIcons after this operation
to verify the icons have changed as expected.
Note 3. The Eclipse 3.4 launcher requires the following 7 images (in any order).
1. 48x48, 32 bit (RGB / Alpha Channel)
2. 32x32, 32 bit (RGB / Alpha Channel)
3. 16x16, 32 bit (RGB / Alpha Channel)
4. 48x48, 8 bit (256 colors)
5. 32x32, 8 bit (256 colors)
6. 24x24, 8 bit (256 colors)
7. 16x16, 8 bit (256 colors)
Note 4. The Eclipse 4.2 launcher requires the following 7 images (in any order).
1. 256x256, 32 bit (RGB / Alpha Channel)
2. 48x48, 32 bit (RGB / Alpha Channel)
3. 32x32, 32 bit (RGB / Alpha Channel)
4. 16x16, 32 bit (RGB / Alpha Channel)
5. 48x48, 8 bit (256 colors)
6. 32x32, 8 bit (256 colors)
7. 16x16, 8 bit (256 colors)
Note 4. This function modifies the content of the executable program and may cause
its corruption.
- Parameters:
launcherFile - the Windows executable e.g c:/eclipse/eclipse.exe
icons - to write to the given executable
- Returns:
- the list of icons from the original program that were not successfully replaced (empty if success)
- Throws:
java.io.FileNotFoundException
java.io.IOException