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

Update registering external tools #3255

Merged
merged 8 commits into from
Jun 21, 2024
Merged

Conversation

andreww-msft
Copy link
Contributor

@andreww-msft andreww-msft commented Jun 18, 2024

Summary

Prior to this, you could only register an external tool identified (and activated) by its filesystem path. This PR adds the ability for the user to select a tool from the list of installed apps (both MSIX-packaged and unpackaged). It also supports both launch/command-line activation and protocol activation.

Details

I added a button to the AddTool control to fetch the list of installed apps, based on the list of per-user installed packages and both common and per-user shortcut lists. I also updated the input section for specifying arguments to use variable substitution on a short list of known parameters (initially, just pid and hwnd). This also makes this section more open-ended, as we can easily extend the list later if required.

The user can provide command-line arguments using any format. Protocol arguments should include the protocol itself, and the protocol's Uri.Query can include the standard name-value pairs, or just names. There's no input validation: it's up to the user to provide arguments that are appropriate for her tools. I added tooltips for all the items on the AddTool control, plus instructions and example text for the launch/protocol argument strings.

As part of this, if the user has an externaltools.json file in the old format, we'll read this in and migrate the data to the new format. For persistence, the tools collection is now wrapped in a new ExternalToolCollection type, which includes a version number, so that going forward we can detect files in different versions and migrate accordingly.

Also fixed a bug where we were writing out the JSON file repeatedly when the ToolIcon and MenuIcon observable properties were changed. Now we only write out changes for properties that are not JsonIgnore.

Also added a custom percentage progress ring for reporting intermittent progress when fetching the list of installed apps, as this can take a few seconds. We can also use this progress ring for other long-running operations.

Filed a new issue to support activation via AppExecutionAlias (with arguments): #3251.

Testing

  • Tested launch/command-line arguments with unpackaged apps.
  • Tested protocol activation with both unpackaged and packaged (both sideloaded and store-deployed) apps.
  • Tested migrating an old-format JSON file to the new format.

References and relevant issues

Fixed the following:

applist-progress

applist

addtool-protocol

Copy link
Contributor

@jaholme jaholme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@zadesai zadesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@timkur timkur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@andreww-msft andreww-msft merged commit d5c04b1 into main Jun 21, 2024
4 checks passed
@andreww-msft andreww-msft deleted the user/andreww/externalToolsV2 branch June 21, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants