问题
I have a Mavenized Netbeans Platform application, and i have followed THIS guide for create an Installer of it.
Now i wanna change the icons of my app, but i don't know how to do.
I have tried some different solutions:
- Changing the icon with ReplaceVistaIcon in THIS way (not a great solution) in the dir
C:\Program Files\NetBeans 8.0\harness
and in.m2\repository\org\codehaus\mojo\nbm-maven-harness\7.3\nbm-maven-harness-7.3.jar
; after installation, the icons returns at default version. - Using Maven in THIS way; same effect.
- Now i wanna try to create a .lnk with the installer (using the correct image) if the user have selected "Create Desktop icon", and i have follow THIS guide, but i don't find the window where the
CheckBox
is showed.
Any solution is acceptable, the important thing is that it works
回答1:
What I have done to achieve this is a mixture of everything you tried.
I indeed changed the icons through ReplaceVistaIcon from the harness. I then placed them inside a directory residing in my Maven Netbeans Application, in my case application/src/main/resources/binaries
. Afterwards I added the element binDirectory
to the configuration of the Maven build plugin of this module:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<configuration>
<brandingToken>${brandingToken}</brandingToken>
<etcConfFile>src/main/resources/myconfig.conf</etcConfFile>
<binDirectory>src/main/resources/binaries</binDirectory>
</configuration>
</plugin>
</plugins>
</build>
This is the way it works for me. I agree, that changing the binaries to contain the right icon is not really the cleanest way. If anyone has a nicer way to achieve this, please let us know.
回答2:
Excellent solution. Did the job for me, thanks padde!
As you said padde, after applying changes with ReplaceVistaIcon on app.exe and app64.exe(more explanation can be found on https://blogs.oracle.com/geertjan/entry/icons_for_netbeans_platform_applications), I only needed to copy app.exe and app64.exe from "NetBeans\harness\launchers\" into "src\main\resources\"
I also noticed that app.exe and app64.exe are different in size from NetBeans 7.3 and 7.3.1. But matches between 7.3.1 and 8.0.2. I believe that we should use the app.exe from NetBeans version that is matching with our project's NetBeans version.
来源:https://stackoverflow.com/questions/25116172/how-to-change-the-icon-of-a-mavenized-netbeans-application