On Fri, 8 Aug 2025 23:23:02 GMT, Alexander Matveev <[email protected]> wrote:
>> - Support a new "app-dir" value of `win-shortcut`, `win-menu`, and
>> `linux-shortcut` properties in additional launcher property files.
>> - Support an optional value of `--win-shortcut`, `--win-menu`, and
>> `--linux-shortcut` CLI options. The valid value is "app-dir".
>>
>> If a value of any property/CLI option from the above list is set to
>> "app-dir", the startup directory of the corresponding shortcut will be set
>> to the "app" subdirectory of the installation directory.
>>
>> If a CLI option from the above list doesn't have a value, the startup
>> directory of the corresponding shortcut for the main launcher will be set to
>> the installation directory on Windows and will not be set on Linux. This is
>> the existing behavior; it has not changed.
>>
>> If a value of a property from the above list evaluates to `true`, the
>> startup directory of the corresponding shortcut for the additional launcher
>> will be set to the installation directory on Windows and will not be set on
>> Linux. This is the existing behavior; it has not changed.
>>
>> Added test cases to AddLShortcut test implicitly.
>
> src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java line 486:
>
>> 484: }
>> 485:
>> 486: private static Runnable
>> createArgumentWithOptionalValueAction(String option) {
>
> I am not sure, but did you test case when `--win-menu` or `--win-shortcut` or
> `--linux-shortcut` is last argument without value? With new code `var value =
> popArg();` will be `""` and we will call `setOptionValue(option, value)`.
> Before change it will be set to `true`.
You are right. I reworked the tests, and they start failing if the last
argument is `--win-menu`, `--win-shortcut`, or `--linux-shortcut`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26707#discussion_r2267483513