-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Windows 11 context menu integration improvement #3307
Comments
Why, Microsoft, why? We where glad we left git-cheetah behind and now we'll have to build COM-Interop shell extension DLLs again. Great. Thank you for warning us about this.
Well, at least for this microsoft has already (almost) provided a solution:
Include the sparse package and the COM-Interop shell extension DLL on Windows 10 installs as well and wrap that registration code so it only fires on Windows 11 (The required APIs to register a sparse package probably won't be available on Windows 10 systems anyways). |
Turns out they are available on Windows 10 since build 2004.
Ok, some more digging reveals the string format they expect. |
I should really stop looking into this. The more I look, the worse things get. This is drifting into the same area of barely (if at all) documented APIs that Wintoast is built around. |
I had an email about a comment that's apparently been deleted:
Those are some good questions. The only source I can find for the Windows 11 Context Menu requiring identity is the claim in that vscode issue. So maybe we can get away with just the COM component. |
@rimrul Yes, sorry, that was me 😬 I googled for |
No need to apologize. I stumbled across the same Windows 7 sample before and thought "Maybe they're reusing the old interface in a new context", but there seems to be absolutely no official documentation that the context menu requires identity now, so we might get away without a sparse package. |
Just like always 😝 It's probably worth trying without a sparse package, because then that COM component could be used on all supported Windows versions. But it seems that a sparse package could be useful at least because it's simpler than all this COM registration code 🤯 Also it's kind of future-proof, so it could be used on Windows 11+ only, falling back to the registry method on previous versions. Windows Terminal also has a COM component, but I'm not sure if they have a sparse package (they use MSIX deployment AFAIK): microsoft/terminal#6100 |
Yes, that would be nice.
It's looks a lot simpler because they only show the C# version and assume you only need to support Windows 10 2004 and newer...
They refer to the Windows 7 sample as
I don't think that's good. |
There is an official announcement of this now: https://blogs.windows.com/blog/2021/07/19/extending-the-context-menu-and-share-dialog-in-windows-11/ |
I spent some time writing a simple helper program that does the Windows 11 menu showing Source Code: https://github.com/baulk/winmenu How to experience:
I think a better solution to this problem is to add the Windows 11 sparse package project in the Git for Windows organization. Then choose whether to install it in the Inno Setup script. If you need to install it, run a custom command to call the powershell script to install it. You can also uninstall appx when uninstalling Git for Windows. |
Setup
defaults?
to the issue you're seeing?
n/a
Details
The upcoming Windows 11 release changes how context menus are registered. While the regkey-based system currently in use will continue to function, such commands will be demoted behind a "Show more options" menu. To be clear, shell integration won't be broken on Win11, but it will be less convenient.
The new model uses what's called an
IExplorerCommand
and requires an "app identity" to attribute the integration. Identity is established for so-called "unpackaged" Win32 (like Git for Windows) using a concept called Sparse Manifests.I believe the work required will be:
if (windows.version == 11 && ext\shellhere == true) { register using IExplorerCommand }
ext\guihere
The Windows team shared sample code. Their PM also offered to help out, should someone in the community wish to pick this work up and run into any trouble. microsoft/vscode#127365 includes a screenshot demonstrating where
IExplorerCommand
s appear.The text was updated successfully, but these errors were encountered: