How to change the icon of a Mavenized Netbeans application

怎甘沉沦 提交于 2019-12-13 21:28:49

问题


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


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!