Summary
Support both system-wide and per-user configuration of a jpackaged application.
Problem
There is no way to set per-user startup parameters for application launchers for installed jpackaged applications.
Installation of jpackaged application is system-wide.
Configurations parameters are stored in .cfg
property files in the system-wide installation directory thus only system-wide configuration is supported.
In some cases user-specific startup parameters need to be specified. Currently, there is no way to do it because startup parameters are stored in the system-wide installation location.
Solution
Add support to jpackage application launcher to look up the corresponding .cfg
file not only in the application installation directory (the system-wide installation location) but also in user-specific locations.
Specification
Application launcher of the installed application will look up the corresponding .cfg
file in user-specific directories. If .cfg
file is not found, the application launcher will load .cfg
file from the installation directory.
Application launcher executed from application image, i.e. not from the installed application will not look up the corresponding .cfg
file in user-specific directories. It will load the corresponding .cfg
file from the application image directory.
User-specific directories for .cfg
file look up will be:
Linux
~/.local/${PACKAGE_NAME}
~/.${PACKAGE_NAME}
macOS
~/Library/Application Support/${PACKAGE_NAME}
Windows
%LocalAppData%\%PACKAGE_NAME%
%AppData%\%PACKAGE_NAME%
${PACKAGE_NAME}
and %PACKAGE_NAME%
refer to jpackaged application name.
E.g.: for a fictional application named Duke
main application launcher will use the first existing .cfg
file from the list:
Linux
~/.local/duke/Duke.cfg
~/.duke/Duke.cfg
/opt/duke/lib/app/Duke.cfg
macOS
~/Library/Application Support/Duke/Duke.cfg
/Applications/Duke.app/Contents/app/Duke.cfg
Windows
%LocalAppData%\Duke\Duke.cfg
%AppData%\Duke\Duke.cfg
%ProgramFiles%\Duke\app\Duke.cfg
E.g.: for a fictional application named Duke
additional application launcher named other-duke
will use the first existing .cfg
file from the list:
Linux
~/.local/duke/other-duke.cfg
~/.duke/other-duke.cfg
/opt/duke/lib/app/other-duke.cfg
macOS
~/Library/Application Support/Duke/other-duke.cfg
/Applications/Duke.app/Contents/app/other-duke.cfg
Windows
%LocalAppData%\Duke\other-duke.cfg
%AppData%\Duke\other-duke.cfg
%ProgramFiles%\Duke\app\other-duke.cfg
- csr of
-
JDK-8250950 Allow per-user and system wide configuration of a jpackaged app
- Resolved
- relates to
-
JDK-8138944 Support command line arguments to the JVM passed to self-contained app launchers
- Closed