3

I'm trying to use jpackage to create an installer for my Java app. I'm on Windows 10 using OpenJDK 15.0.1. I should be able to build an installer using

jpackage --input C:\MyApp --main-jar MyApp.jar

UPDATE: I originally posted that trouble happened when I use the --app-image option, but it happens with just the basic command.

This runs without error, but the resulting executable MyApp-1.0.exe fails to complete. When I run it, a window briefly pops up and disappears before I have time to read it, then nothing further happens. It never gets to the point of asking, "Do you want to allow this app to make changes?". Then if I try to delete MyApp-1.0.exe, Windows tells me, "The action can't be completed because the file is open in installer of MyApp." After I restart Windows I'm able to delete the installer.

Occasionally I'm able to produce an installer that works, and I gleefully jump to the conclusion that whatever variation I just tried is a fix, only to have it fail the next time I try it. Success or failure seems to be random. In particular I've got one version of an installer that works on my Windows 10 laptop, but hangs on my Windows 10 desktop computer.

I've tried it with the early access version of JDK 16 from jdk.java.net, and the problem persists.

This is a follow-up to two earlier posts: jpackage crashes when creating an installer with the --app-image option and jpackage --type app-image creates infinite recursive directories

Jerry Agin
  • 629
  • 1
  • 5
  • 15

1 Answers1

1

I just found the following post: Cannot rerun Java JPackage installer if already installed, second time just exits without warning

The installation fails if the app is already installed in \Program Files. The solution is to either uninstall, or to increment the version number.

Jerry Agin
  • 629
  • 1
  • 5
  • 15