i am using javapackager to create an exe installer with jre bundled using the command line.
does anybody know how to add an icon and customise the installer using the command line.
these are the commands that i use:
javapackager -deploy -native -outdir packages -outfile myFile
-srcdir documents -srcfiles Application.jar -appclass application.Main
-name "Application" -title "Application Title"
i have tried to add license="info" and some other commands
As documented, use the option icon
with the prefix -B
to use a custom icon:
-Bicon=app.ico
or alternatively put the icon file at package/windows/appName.ico
.
Here is a complete example for generating an EXE setup file:
PREREQUISITES:
- This will work on Windows only.
- You need to install Inno Setup 5 or newer from http://www.jrsoftware.org and add it to the PATH.
COMMAND:
javapackager -deploy -native exe -Bruntime="C:\Program Files\Java\jdk1.8.0_66\jre" -Bicon=app_icon.ico -BsystemWide=true -BshortcutHint=true -outdir packages -outfile appFile -srcdir dist -srcfiles MyApp.jar;COPYING.txt -appclass somePackage.MainClass -BlicenseFile=COPYING.txt -name appName -title "The application name"
EXTRA:
- You can customize the logo of the installer dialog by adding the following file (max-size = 55x58 pixels):
package/windows/appName-setup-icon.bmp
- The following files are detected as well:
package/windows/appName.iss (Inno Setup project file)
package/windows/appName-post-image.wsf (script to run after application image is populated)
- Use the verbose option
-v
to see more details while javapackager
is executed. After javapackager
completes, it will print a message like this:
Config files are saved to C:\Users\Fouad\AppData\Local\Temp\fxbundler3314360063389283581\windows. Use them to customize package.
You will find the following useful files in that folder:
- appName.ico
- appName.iss
- appName-setup-icon.bmp
For more:
- The Java Packager Tool.
- javapackager (Windows) documentation.