-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8288838: jpackage: file association additional arguments #9224
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
Conversation
|
👋 Welcome back akasko! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
What would be the alternative to |
| xml.writeAttribute("Command", "Open"); | ||
| xml.writeAttribute("Argument", "\"%1\""); | ||
| if (fa.passAllArguments) { | ||
| xml.writeAttribute("Argument", "\"%1\" %*"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if simple "%*" would be sufficient to preserve arguments with spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added argument with spaces to the test, they seem to be passed correctly (with existing unquoted %*) with both command line invocation and with a shortcut.
As this is intended to be a public property, I assume there should be a CSR and some consistent name, perhaps with
Can we change the existing default behaviour? Should we? It won't break existing usage, but is it actually always desired to support passing arbitrary arguments from the desktop shortcut to the target java app? I myself cannot answer any of these questions. |
Agree. At least we need to provide l10n for it.
The existing behavior simply cuts off all, but the first argument from the argument array passed to the app launcher. Changing this looks more like a fix of a bug, than an enhancement. |
For runtime installers it would be great to have a custom verb label, to be able to use something like: "Open with VendorName OpenJDK". I intend to prototype this and file in a separate PR (there is a related point about the "ampersand for keyboard shortcut" in this label, that is currently unclear). |
I've experimented with this, used following example app:
Arguments placeholders specified In a
Based on the above I've updated the patch dropping the property and changing the I would appreciate the guidance on the test changes (note, |
Sounds good.
Oh, interesting. I didn't know that! Thank you for providing a detailed explanation.
I put proposed changes to test classes in #9331 PR. I hope the approach gives enough flexibility to configure testing of fa. We can configure all possible test configurations in |
|
@akashche Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information. |
|
I've rebased the changes on top of PR 9331 and rebased the result on top of recent master (to have JDK-8288961 to be able to run MSI test). I think the patch if ready for review now. Note on non-ASCII arguments support: I've found that Windows system locale needs to be changed to support specific language. Checked manually that such args are passed successfully with both command-line and LNK shortcut arguments. Left a note on this in test. |
|
Looks good! I'll try the patch locally and get back to you. |
|
About the non-ASCII args: in If it is desired to be able to run such non-ASCII test manually (without changing the test code), I assume this can be done by making the test to read arguments from filesystem, or to add some kind of a test option to run the branch with predefined non-ASCII arguments only when requested. |
|
I confirm the patch works and there are no regressions. SQE uses only the part of jpackage jtreg tests that create test packages, so there is no point in customizing tests with reading args from the file system. I think I have enough information to help SQE update test spec and cover Unicode args. |
| .applyTo(packageTest); | ||
|
|
||
| packageTest.run(); | ||
| packageTest.run(RunnablePackageTest.Action.CREATE, RunnablePackageTest.Action.INSTALL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: the default test steps can be overridden with the value of jpackage.test.action system property.
Its value would be create,install,verify_install,uninstall for this case.
UPD: Nevermind this comment. It applied to the old version of the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info! I've seen jpackage.test.action property in run_tests.sh, but never used it.
|
@akashche This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 46 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@alexeysemenyukoracle, @sashamatveev) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
/sponsor |
|
@alexeysemenyukoracle The change author (@akashche) must issue an |
|
/integrate |
|
Thanks for the reviews! |
|
/sponsor |
|
Going to push as commit a694e9e.
Your commit was automatically rebased without conflicts. |
|
@alexeysemenyukoracle @akashche Pushed as commit a694e9e. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
jpackage implementation of file association on Windows currently passes a selected filename as an only argument to associated executable.
It is proposed to introduce additional option in file association property file to allow optionally support additional arguments using
%*batch wildcard.Note, current implementation, while fully functional, is only a DRAFT one, it is not ready for integration in this form. I would appreciate any guidance on the following points:
pass-all-argsis usedFileAssociationTestand piggybacks on the existing (and unrelated)includeDescriptionparameter; it is not clear whether it should be done in a separate test and whether to include runs for every parameter combinationjava.awt.DesktopAlso please note, that full install/uninstall run is currently enabled in
FileAssociationTest, it is intended to be used only in a draft code during the development and to be removed (to use the same "install or unpack" logic as other tests) in a final version.Testing:
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9224/head:pull/9224$ git checkout pull/9224Update a local copy of the PR:
$ git checkout pull/9224$ git pull https://git.openjdk.org/jdk pull/9224/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9224View PR using the GUI difftool:
$ git pr show -t 9224Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9224.diff