fvarrui / JavaPackager

:package: Gradle/Maven plugin to package Java applications as native Windows, MacOS, or Linux executables and create installers for them.
GNU General Public License v3.0
1.07k stars 134 forks source link

exe icon is wrong #354

Closed tanhuang2016 closed 1 year ago

tanhuang2016 commented 1 year ago

I'm submitting a…

Short description of the issue/suggestion: I packaged the jar into an exe file and set the icon, but the icon for the exe did not take effect

Steps to reproduce the issue/enhancement:

  1. [First Step] this is maven pom
     <plugin>
                <groupId>io.github.fvarrui</groupId>
                <artifactId>javapackager</artifactId>
                <version>1.7.2</version>
                <executions>
                    <execution>
                        <id>bundling-for-windows</id>
                        <phase>package</phase>
                        <goals>
                            <goal>package</goal>
                        </goals>
                        <configuration>
                            <mainClass>xyz.hashdog.rdm.ui.Main</mainClass>
                            <bundleJre>true</bundleJre>
                            <jrePath>C:\Program Files\Java\jdk-1.8\jre</jrePath>
                            <generateInstaller>false</generateInstaller>
                            <administratorRequired>false</administratorRequired>
                            <platform>windows</platform>
                            <createZipball>true</createZipball>
                            <winConfig>
                                <icoFile>src/main/resources/icon/redis256.ico</icoFile>
                            </winConfig>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

    2 [Second Step] The packaged directory already has the icon I set, but the icon of the exe program is wrong image

What is the expected behavior? exe icon should be the same as the set ico

What is the current behavior? But now you can see that the icon is wrong

Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Other information (e.g. related issues, suggestions how to fix, links for us to have context)

fvarrui commented 1 year ago

Hi @tanhuang2016! Please, could you share Maven output?

fvarrui commented 1 year ago

I'm not able to reproduce your issue ... if I do the same, it works fine.

Oh, and there have been some changes related to icons in Windows in version 1.7.3. Could you try this version?

tanhuang2016 commented 1 year ago

我无法重现您的问题...如果我这样做,它就可以正常工作。

哦,在 1.7.3 版本中,Windows 中的图标也发生了一些变化。你能试试这个版本吗?

Switching to 1.7.3 is ok Thank you for your answer