Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for additional launchers #3640

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

alchitry
Copy link

@alchitry alchitry commented Sep 7, 2023

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
Copy link
Contributor

amir1376 commented Apr 10, 2024

i also need that feature.Thanks

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.

None yet

2 participants