Search code examples
javamavennetbeansiconsnetbeans-platform

How to change the icon of a Mavenized Netbeans application


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:

  1. 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.
  2. Using Maven in THIS way; same effect.
  3. 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


Solution

  • 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.