Summary
Support configuration of a working directory for application launcher shortcuts.
Problem
jpackage supports adding shortcuts for the main and additional application launchers. The application installer will install the configured shortcuts.
On Windows, an application launcher can have a desktop shortcut and/or a start menu shortcut. On Linux, an application launcher can have a start menu shortcut. Shortcuts are not supported on macOS.
Even though Linux and Windows shortcuts support the working directory property, there is no jpackage option to configure it. On Windows, the working directory is set to the application's installation directory; on Linux, it is not set.
Solution
On Windows, the --win-shortcut
and --win-menu
boolean CLI options control whether the main launcher should have a desktop and start menu shortcuts, respectively. The win-shortcut
and win-menu
boolean properties apply to additional launchers.
On Linux, the --linux-shortcut
boolean CLI option controls whether the main launcher should have a start menu shortcut. The linux-shortcut
boolean property applies to additional launchers.
Enhance the type of CLI options and properties controlling shortcuts. Add "app-dir" constant to the list of recognized values.
"app-dir" indicates that a shortcut's working directory should be set to the "app" subdirectory of the application's installation directory.
Specification
The current handling of CLI options and properties controlling shortcuts remains unchanged:
- If a CLI option is not present, the corresponding shortcut for the main launcher will not be added to the installer.
- If a CLI option is present and doesn't have a value, the corresponding shortcut for the main launcher will be added to the installer with the working directory configured as described in the "Problem" section.
- If a property is not present or set to "false" in the additional launcher property file, the corresponding shortcut for the additional launcher will not be added to the installer.
- If a property is set to "true" in the additional launcher property file, the corresponding shortcut for the additional launcher will be added to the installer with the working directory configured as described in the "Problem" section.
- Additional launchers inherit shortcut configuration from the main launcher.
The CLI options will support an optional value. Valid value will be "app-dir" string.
On Windows:
- If the value of a CLI option is "app-dir", the working directory of the corresponding shortcut will be set to the "app" subdirectory of the application's installation directory.
- Shortcut properties in additional launcher property files will similarly support the "app-dir" value.
On Linux:
- If the value of the
--linux-shortcut
CLI option is "app-dir", the shortcut's working directory will be set to the "app" subdirectory of the application's installation directory. - The
linux-shortcut
property in additional launcher property files will similarly support "app-dir" value.
If the value of a shortcut CLI option or a property is set to an unrecognized value, jpackage will exit with an error.
- csr of
-
JDK-8308349 missing working directory option for launcher when invoked from shortcuts
-
- Resolved
-