Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Update registering external tools - #3255

Merged
andreww-msft merged 8 commits into
mainfrom
user/andreww/externalToolsV2
Jun 21, 2024
Merged

Update registering external tools#3255
andreww-msft merged 8 commits into
mainfrom
user/andreww/externalToolsV2

Conversation

@andreww-msft

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

Copy link
Copy Markdown
Contributor

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

Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Controls/ProgressTextRing.xaml Outdated
Comment thread tools/PI/DevHome.PI/Helpers/ExternalTool_v1.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Helpers/ExternalTool.cs
Comment thread tools/PI/DevHome.PI/Helpers/ExternalTool.cs
Comment thread tools/PI/DevHome.PI/Helpers/ExternalTool.cs
Comment thread tools/PI/DevHome.PI/Helpers/ExternalTool_v1.cs
Comment thread tools/PI/DevHome.PI/Helpers/ExternalTool_v1.cs Outdated
Comment thread tools/PI/DevHome.PI/Helpers/ExternalTool_v1.cs
Comment thread tools/PI/DevHome.PI/Helpers/ExternalToolsHelper.cs
Comment thread tools/PI/DevHome.PI/Helpers/WindowHelper.cs Outdated
Comment thread tools/PI/DevHome.PI/Models/InstalledAppInfo.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs

@jaholme Jason Holmes (jaholme) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs Outdated
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Controls/AddToolControl.xaml.cs
Comment thread tools/PI/DevHome.PI/Helpers/WindowHelper.cs
Comment thread tools/PI/DevHome.PI/Helpers/ExternalTool.cs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

@timkur Tim Kurtzman (timkur) left a comment

Copy link
Copy Markdown
Contributor

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
@andreww-msft
andreww-msft deleted the user/andreww/externalToolsV2 branch June 21, 2024 22:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

6 participants