-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 10 exe file detail info has messy code text #325
Comments
Hi @ClayGminx! |
Hi @ClayGminx! Please, could you try setting <plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<mainClass>claygminx.worshipppt.Main</mainClass>
<bundleJre>true</bundleJre>
<customizedJre>true</customizedJre>
<jdkPath>C:\Program Files\Java\jdk1.8.0_351</jdkPath>
<jrePath>jre</jrePath>
<generateInstaller>false</generateInstaller>
<administratorRequired>false</administratorRequired>
<platform>auto</platform>
<createZipball>true</createZipball>
<createTarball>true</createTarball>
<url>https://github.com/ClayGminx/worship-ppt</url>
<additionalResources>
<additionalResource>config</additionalResource>
<additionalResource>PPT模板</additionalResource>
<additionalResource>数据库</additionalResource>
<additionalResource>README.md</additionalResource>
</additionalResources>
<winConfig>
<copyright>Joseph Mark</copyright>
<language>SIMPLIFIED_CHINESE</language>
</winConfig>
</configuration>
</execution>
</executions>
</plugin> |
<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<displayName>中文测试</displayName>
<mainClass>org.example.SignTest</mainClass>
<bundleJre>true</bundleJre>
<customizedJre>true</customizedJre>
<jdkPath>C:\Program Files\Java\jdk1.8.0_171</jdkPath>
<jrePath>${java.home}</jrePath>
<generateInstaller>false</generateInstaller>
<administratorRequired>false</administratorRequired>
<platform>auto</platform>
<createZipball>true</createZipball>
<createTarball>true</createTarball>
<url>https://github.com/ClayGminx/worship-ppt</url>
<additionalResources>
<additionalResource>config</additionalResource>
<additionalResource>PPT模板</additionalResource>
<additionalResource>数据库</additionalResource>
<additionalResource>README.md</additionalResource>
</additionalResources>
<winConfig>
<copyright>Joseph Mark</copyright>
<language>SIMPLIFIED_CHINESE</language>
</winConfig>
</configuration>
</execution>
</executions>
</plugin> |
hi @lhDream! |
Maybe due to the encoding of my pom.xml is UTF-8, but my win10 encoding is GBK. I test it usding SIMPLIFIED_CHINESE, but still messy code. |
If due to different encoding, can you transform it? |
We can't distribute RH with JavaPackager, but maybe JP can use it if the user pre-installs it, like it's done with Inno Setup, for example. Right now JP is using According to RH docs, it can be used from command line with its own scripting language: ResourceHacker.exe -script ScriptFile |
After some testing I've realized that you can use <plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<mainClass>claygminx.worshipppt.Main</mainClass>
<bundleJre>true</bundleJre>
<customizedJre>true</customizedJre>
<jdkPath>C:\Program Files\Java\jdk1.8.0_351</jdkPath>
<jrePath>jre</jrePath>
<generateInstaller>false</generateInstaller>
<administratorRequired>false</administratorRequired>
<platform>auto</platform>
<createZipball>true</createZipball>
<createTarball>true</createTarball>
<url>https://github.com/ClayGminx/worship-ppt</url>
<additionalResources>
<additionalResource>config</additionalResource>
<additionalResource>PPT模板</additionalResource>
<additionalResource>数据库</additionalResource>
<additionalResource>README.md</additionalResource>
</additionalResources>
<winConfig>
<exeCreationTool>why</exeCreationTool> <!-- CHANGE HERE -->
<copyright>Joseph Mark</copyright>
<language>zh_CN</language>
</winConfig>
</configuration>
</execution>
</executions>
</plugin> |
I'm not sure if the problem is due to Launch4j or launch4j-maven-plugin. Have you tried to build your EXE using Launch4j GUI? |
Hi @ClayGminx! I've been doing some tests with your project and I think I finally found a solution. I don't know why I also had to improve several things in JP, because some metadata was not being set in the EXE file when using Set <pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>nexus-snapshot-repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories> Please, try it and give me some feedback. Thanks! |
I forgot it: <execution>
<id>bundling-for-windows</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>windows</platform>
<createZipball>false</createZipball>
<createTarball>false</createTarball>
<jrePath>C:\Program Files\Java\jdk1.8.0_211\jre</jrePath>
<winConfig>
<exeCreationTool>winrun4j</exeCreationTool>
<!--
<fileDescription>A worship PPT Tool</fileDescription>
-->
<copyright>Joseph Mark</copyright>
</winConfig>
</configuration>
</execution> If you don't specify You can also download and unzip a JRE for MacOS on Windows and set
|
@fvarrui Thank you. I will try it soon. |
@fvarrui Hello! I tried it. I used the following pom.xml <build>
<finalName>${project.name}-${project.version}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>*.*</include>
<include>templates/*.*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>pptx</nonFilteredFileExtension>
<nonFilteredFileExtension>db</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.7.3-20230613.105302-8</version>
<configuration>
<mainClass>claygminx.worshipppt.Main</mainClass>
<bundleJre>true</bundleJre>
<customizedJre>true</customizedJre>
<url>https://github.com/ClayGminx/worship-ppt</url>
<generateInstaller>false</generateInstaller>
<administratorRequired>false</administratorRequired>
<additionalResources>
<additionalResource>config</additionalResource>
<additionalResource>PPT模板</additionalResource>
<additionalResource>数据库</additionalResource>
<additionalResource>README.md</additionalResource>
</additionalResources>
</configuration>
<executions>
<execution>
<id>bundling-for-windows</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>windows</platform>
<createZipball>true</createZipball>
<createTarball>false</createTarball>
<jrePath>jre-win</jrePath>
<winConfig>
<exeCreationTool>winrun4j</exeCreationTool>
<wrapJar>true</wrapJar>
<fileDescription>A worship PPT Tool</fileDescription>
<copyright>Joseph Mark</copyright>
<language>SIMPLIFIED_CHINESE</language>
</winConfig>
</configuration>
</execution>
<execution>
<id>bundling-for-mac</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>mac</platform>
<createZipball>true</createZipball>
<createTarball>false</createTarball>
<jrePath>jre-mac</jrePath>
<macConfig>
<generateDmg>false</generateDmg>
<generatePkg>false</generatePkg>
</macConfig>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>nexus-snapshot-repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories> I tried to package in Intellij IDEA ULTIMATE 2020.1, and my OS is Windows 10 家庭中文版 22H2. However, the maven package failed. The last important package log is:
Then I tried to execute the command from the above log in cmd.exe:
But failed.
|
@ClayGminx it seems to be using JRE instead of JDK path, since it could't find the |
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) |
@fvarrui Thank you for your suggestion that I can package using GitHub Action, but I want to use customized jre, because the jre on Windows OS is too large. |
If you want to generate a customized JRE you need a higher Java version (JDK 9+), which includes |
I think you should set This is mine: C:\> mvn -v
Apache Maven 3.9.0 (9b58d2bad23a66be161c4664ef21ce219c2c8584)
Maven home: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.0
Java version: 19.0.2, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-19.0.2.7-hotspot
Default locale: es_ES, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows" |
My |
Hi @ClayGminx! I'm not sure what's wrong in your config, but as you can see in Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: D:\Apps\apache-maven-3.6.3\bin..
Java version: 1.8.0_351, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_351\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows" When you use WinRun4J with JP, it generates a
But as I said before, if you want a customized JRE you have to use a JDK 9+. |
@fvarrui I'm waiting for your reply in fact. I believe my config of Java and Maven is true. Although I switch Maven version from 3.6 to 3.9, the runtime of Maven is still When I edit my reply, I try to switch my JDK version to 17 which doesn't have jre directory, and I set
Although, I don't want to upgrade my JDK version. Additionally, the method of using customized JRE 8 or reducing JRE 8 is removing files about JavaFX. |
This confused me a bit, since As I mentioned earlier, JP uses the JDK's [INFO] Executing command: cmd.exe /s /c ""C:\Program Files\Java\jdk1.8.0_351\jre\bin\jar" uf "D:\Workspace\worship-ppt\target\Worship PPT\libs\winrun4j-launcher.jar" winrun4j.properties"
[ERROR] '"C:\Program Files\Java\jdk1.8.0_351\jre\bin\jar"' �����ڲ����ⲿ���Ҳ���ǿ����еij���
[ERROR] ���������ļ��� Here the code: JavaPackager/src/main/java/io/github/fvarrui/javapackager/utils/JarUtils.java Lines 10 to 13 in 05a2195
I think that replacing line 11 with next fix the problem: File jar = new File(System.getenv("JAVA_HOME"), "/bin/jar"); so
|
If you agree with me, I'll code a patch for this and publish a snapshot version, so you can test it. |
Changes made in branch |
Thank you! Agree. |
@fvarrui Thank you. Now when I use the snapshot version |
issue-325 branch merged into devel, ready to be released in v1.7.3 |
1.7.3 released to Maven Central |
I'm submitting a…
As the following picture display, the detail info in exe file has messy code text.
Note that my true description is "一个用于自动制作敬拜PPT的小工具".
Additional issue, my expect language is "简体中文", but it display "英语(美国)".
Following is my pom.xml
And following is the exe file detail info.
The text was updated successfully, but these errors were encountered: