beryx / badass-runtime-plugin

Create a custom runtime image of your non-modular application
https://badass-runtime-plugin.beryx.org
Apache License 2.0
162 stars 21 forks source link

additional launcher #70

Open mitm001 opened 4 years ago

mitm001 commented 4 years ago

I am new to jpackage but have spent some time trying to get it to work with my current build procedures.

My current build behavior has a src/main/dist folder that contains an updater application that has its own start script and is not on the class path of the main application. This folder gets added to the distribution during build, maintaining the same folder structure as is in the dist folder.

The main application uses ProcessBuilder to start this updater when it needs to. The updater uses ProcessBuilder to start the main application when it needs to.

I think this is an secondaryLauncher in the jlink plugin but this doesn't seem to work in the runtime plugin, even though I see nothing in the jpackage docs saying a non modular build cannot have an additional launcher.

Is there a way I can add the updater and its start script using the runtime plugin that maintains the folder structure inside the installed applications app folder?

mitm001 commented 4 years ago

More reading shows missing installer option --input as well as the secondaryLauncher would accomplish these things.

siordache commented 4 years ago

There is currently no support for additional launchers in the runtime plugin, so you need to add a couple of things to your build.gradle to make it work. I put up an example on the secondaryLauncher branch of badass-runtime-example-javafx.

The main steps are: