Skip to content

Support for additional launchers - #3640

Open
alchitry wants to merge 7 commits into
JetBrains:masterfrom
alchitry:additional-launchers
Open

Support for additional launchers#3640
alchitry wants to merge 7 commits into
JetBrains:masterfrom
alchitry:additional-launchers

Conversation

@alchitry

@alchitry alchitry commented Sep 7, 2023

Copy link
Copy Markdown

For my application I need the installer to include two launchers with different arguments. It turns out JPackage supports this so I added support to add the necessary flags.

WIth this addition, you can specify additional launchers in the nativeDistributions block like this.

compose.desktop {
    application {
        mainClass = "com.alchitry.labs.MainKt"
        nativeDistributions {
            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
            packageName = "Alchitry Labs"
            packageVersion = (version as String).split("-").first()
            vendor = "Alchitry"

            additionalLauncher("Alchitry Loader") {
                add("arguments","loader")
            }
        }
    }
}

You pass arguments to add to the properties file through the add function.

Here's the relevant doc for the add-launcher flag.

--add-launcher name=path
Name of launcher, and a path to a Properties file that contains a list of key, value pairs

(absolute path or relative to the current directory)

The keys "module", "main-jar", "main-class", "description", "arguments", "java-options", "app-version", "icon", "launcher-as-service", "win-console", "win-shortcut", "win-menu", "linux-app-category", and "linux-shortcut" can be used.

These options are added to, or used to overwrite, the original command line options to build an additional alternative launcher. The main application launcher will be built from the command line options. Additional alternative launchers can be built using this option, and this option can be used multiple times to build multiple additional launchers.

@amir1376

AmirHossein Abdolmotallebi (amir1376) commented Apr 10, 2024

Copy link
Copy Markdown
Contributor

i also need that feature.Thanks

@ghost

Copy link
Copy Markdown

i also need that feature.Thanks

It's been over a year, so it looks like we won't be able to wait for this for a while

@alchitry

alchitry commented Nov 1, 2024

Copy link
Copy Markdown
Author

I ended up using Hydraulic Conveyor which has been excellent.

@kwstasch

Copy link
Copy Markdown

Hello update please;

@tanin47

Copy link
Copy Markdown

KMP should've supported passing arbitrary arguments to jpackage. Without it, everyone who needs a feature like this is blocked with no way around it, and the PR is a year old...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants