简体   繁体   English

如何更改Mavenized Netbeans应用程序的图标

[英]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. 我有一个Mavenized Netbeans Platform应用程序,并且已经按照指南创建了它的安装程序。

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 ; 更改与ReplaceVistaIcon图标的目录方式(不是一个很好的解决方案) C:\\Program Files\\NetBeans 8.0\\harness.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; 在使用Maven 方式; 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. 现在,我想尝试使用安装程序(使用正确的图像)创建.lnk(如果用户选择了“创建桌面图标”),并且我已遵循指南,但找不到显示CheckBox的窗口。

Any solution is acceptable, the important thing is that it works 任何解决方案都是可以接受的,重要的是它可以工作

What I have done to achieve this is a mixture of everything you tried. 我为实现这一目标所做的就是将您尝试过的所有事情混合在一起。

I indeed changed the icons through ReplaceVistaIcon from the harness. 我确实通过线束中的ReplaceVistaIcon更改了图标。 I then placed them inside a directory residing in my Maven Netbeans Application, in my case application/src/main/resources/binaries . 然后,我将它们放在Maven Netbeans应用程序中的目录中,在本例中为application/src/main/resources/binaries Afterwards I added the element binDirectory to the configuration of the Maven build plugin of this module: 之后,我将元素binDirectory添加到该模块的Maven构建插件的配置中:

<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. 如果有人有更好的方法来实现这一目标,请告诉我们。

Excellent solution. 优秀的解决方案。 Did the job for me, thanks padde! 为我完成了工作,谢谢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\\" 正如您所说的padde,在app.exe和app64.exe上使用ReplaceVistaIcon进行更改后(可以在https://blogs.oracle.com/geertjan/entry/icons_for_netbeans_platform_applications上找到更多说明),我只需要复制app.exe和app64.exe从“ NetBeans \\ harness \\ launchers \\”到“ src \\ main \\ resources \\”

I also noticed that app.exe and app64.exe are different in size from NetBeans 7.3 and 7.3.1. 我还注意到app.exe和app64.exe的大小与NetBeans 7.3和7.3.1有所不同。 But matches between 7.3.1 and 8.0.2. 但是在7.3.1和8.0.2之间匹配。 I believe that we should use the app.exe from NetBeans version that is matching with our project's NetBeans version. 我相信我们应该使用与项目的NetBeans版本匹配的NetBeans版本的app.exe。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM