Git Product home page Git Product logo

Comments (5)

yiding-he avatar yiding-he commented on July 30, 2024 1

@fvarrui Unfortunately the executable stopped working after using rcedit. And then I found a nice tool resourcehacker to do this.
ResourceHacker_7ckTrx3IfK

from javapackager.

fvarrui avatar fvarrui commented on July 30, 2024

It's an encoding related issue, but I'm not sure if it's related to JavaPackager, launch4j-maven-plugin or launch4j.

Please, could you comment JavaPackager plugin in your POM and try to use next config?

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-dependency-plugin</artifactId>
			<executions>
				<execution>
					<id>copy-dependencies</id>
					<phase>prepare-package</phase>
					<goals>
						<goal>copy-dependencies</goal>
					</goals>
					<configuration>
						<outputDirectory>${project.build.directory}/libs</outputDirectory>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-jar-plugin</artifactId>
			<version>3.1.1</version>
			<executions>
				<execution>
					<phase>package</phase>
					<goals>	
						<goal>jar</goal>
					</goals>
					<configuration>
						<classifier>runnable</classifier>
						<archive>
							<manifest>
								<addClasspath>true</addClasspath>
								<classpathPrefix>libs/</classpathPrefix>
								<mainClass>[PATH TO YOUR MAIN CLASS]</mainClass>
							</manifest>
						</archive>
						<finalName>myjar</finalName>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>com.akathist.maven.plugins.launch4j</groupId>
			<artifactId>launch4j-maven-plugin</artifactId>
			<version>1.7.25</version>
			<executions>
				<execution>
					<phase>package</phase>
					<goals>
						<goal>launch4j</goal>
					</goals>
					<configuration>
						<headerType>gui</headerType>
						<jar>${project.build.directory}/myjar-runnable.jar</jar>
						<outfile>${project.build.directory}/myexe.exe</outfile>
						<classPath>
							<mainClass>[PATH TO YOUR MAIN CLASS]</mainClass>
						</classPath>
						<jre>
							<path>%JAVA_HOME%</path>
						</jre>
						<versionInfo>
							<fileVersion>1.2.3.4</fileVersion>
							<txtFileVersion>txt file version</txtFileVersion>
							<fileDescription>[YOUR DESCRIPTION HERE]</fileDescription>
							<copyright>my copyright</copyright>
							<productVersion>4.3.2.1</productVersion>
							<txtProductVersion>txt product version</txtProductVersion>
							<productName>myproduct</productName>
							<internalName>myexe</internalName>
							<originalFilename>myexe.exe</originalFilename>
						</versionInfo>
					</configuration>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

from javapackager.

fvarrui avatar fvarrui commented on July 30, 2024

I've tried Launch4j in standalone mode and used some CJK characters in file description, and generated executable also shows "?" instead.

from javapackager.

fvarrui avatar fvarrui commented on July 30, 2024

I found a workaround ... rcedit is a command line tool for Windows which let you set file description of a Windows exe file.

I used it on PowerShell with CJK characters and it works fine:

rcedit-x64.exe myexe.exe --set-version-string FileDescription "你好"

image

from javapackager.

fvarrui avatar fvarrui commented on July 30, 2024

Great!

But rcedit would have been a good option to automate the process, e.g.:

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>exec-maven-plugin</artifactId>
	<version>1.6.0</version>
	<executions>
		<execution>
			<phase>package</phase>
			<goals>
				<goal>exec</goal>
			</goals>
			<configuration>
				<executable>rcedit-x64</executable>
				<commandlineArgs>${project.build.directory}/myexe.exe --set-version-string FileDescription "${project.description}"</commandlineArgs>
			</configuration>
		</execution>
	</executions>
</plugin>

But you are right, it's a shame it doesn't work.

from javapackager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.