Note that there are some explanatory texts on larger screens.

plurals
  1. POReplacing icon in Windows *.exe from open-source platform-independent Java code
    primarykey
    data
    text
    <p>First of all, this is not a duplicate of the very common question of making an EXE from Java classes. I do not need to do that.</p> <p>To solve NetBeans <a href="http://netbeans.org/bugzilla/show_bug.cgi?id=64612" rel="noreferrer">RFE #64612</a> without <a href="http://wiki.netbeans.org/DevFaqExecutableIcon#Windows_Icons" rel="noreferrer">manual steps</a> I need a Java (6+) library which can take an <em>existing</em> Windows <code>*.exe</code> file and replace its icon with a substitute in a common format. The executable, which is generic and prebuilt (distributed in binary form), already knows how to load an application-specific config file and then start the JRE with various application JARs etc.; the only problem is that it has a generic icon, and I would like to replace that icon as part of a pure Java build with an application-specific icon, so it looks prettier.</p> <p>The library must be available under a nonviral open-source license; cross-platform (must run on Windows, Linux, Mac, Solaris) so cannot fork some OS-specific helper tool; and must accept PNG input, though the EXE must work on XP so <a href="http://en.wikipedia.org/wiki/ICO_(file_format)#History" rel="noreferrer">according to Wikipedia</a> should embed BMP format. At a high level, supposing Ant as a build tool, I would like something like this:</p> <p><code>&lt;replaceicon from="app.exe" to="hello.exe" icon="hello.png"/&gt;</code></p> <p>Does anyone know if a tool matching these specifications already exists? From various web searches I found <a href="http://launch4j.sourceforge.net/" rel="noreferrer">Launch4J</a>, but this appears to just fork <a href="http://sourceware.org/binutils/docs/binutils/windres.html" rel="noreferrer">windres</a> for the real work, thus not trivially portable. I found <a href="http://jsmooth.sourceforge.net/" rel="noreferrer">JSmooth</a> which looks more promising - appears to include Java code to handle the ICO codec and manipulate PE files - but it is GPL. <a href="http://winrun4j.sourceforge.net/" rel="noreferrer">WinRun4J</a> looks to use native code for icon manipulation, though I had a hard time following its sources. <a href="http://java.sun.com/products/jimi/" rel="noreferrer">Jimi</a> supposedly handles the ICO format (for that matter the standard <code>javax.imageio</code> seems to as well) but I guess has no facility for updating PE resources.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload