-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[PowerRename][ImageResizer] Tier1 Win11 Context menu #19000
Conversation
…ft/PowerToys into stefan/tier1_contextmenu
Unregister package on uninstall Remove unneeded files Cleanup
FindPackages() method needs admin privileges. This reverts commit 5af584f.
Minor cleanups Move logic to package.h
Expect.txt
Does this also apply to "special" folders? / is there a check to prevent critical (system/user) folders being renamed? |
The idea is to add tier1 support and keep it as it was in standard context menu for now. If we want to group items in single PowerToys menu, it should be like that for both Win10 and Win11 menus. That would need some additional rework for both logics.
No, it doesn't.
Good point, I'll double check this. |
- check if selection renamable - minor cleanup - struct initialization
Done |
This is a big one. Quite a fix for 19k! |
I think something like |
Makes sense. Added. Thanks |
ff727c9
to
1fb705f
Compare
…e error Don't generate empty STRINGTABLE for resx files without data
1fb705f
to
1dc5b54
Compare
@stefansjfw Ugh, you can't imagine how much joy this brings me haha :). Great job! |
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.
LGTM! Great work!
After merging this, please open an issue regarding investigating how to avoid needing to restart explorer for the context menu to recognize the new entries under Windows 11.
@stefansjfw |
And an issue to add package check to bugreport tool. |
Added package check to bugreport tool |
} | ||
catch (...) | ||
{ | ||
printf("Failed to report installed context menu packages"); |
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.
We should catch per package and we should write xyz: not found/registered
if a package isn't inatalled. This makes reading/analyzing the bug report easier.
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.
Do you improve this in a second step?
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 think it's a minor difference.. we only have 2 packages to report. If package is not listed in the file - it's not installed/registered, so as soon as someone open the file it's clear whether all packages are there or not
Summary of the Pull Request
Add tier1 context menu items (Win11) for PowerRename and ImageResizer:
Also, with tier1 context menu PowerRename can be started by right-clicking directory background (no need to select items):
PR Checklist
Detailed Description of the Pull Request / Additional comments
Tier1 context menu are added by registering sparse packages for both PowerRename and ImageResizer. Packages are registered per user on module->enable() (conditionally if win11 and if not already registered). Packages are unregistered on PowerToys uninstall.
Also, minimum supported windows version is bumped to 10.0.19041.0 as sparse packaged registration API is added there. Also, end of support for previously used min version (10.0.18362.0) was 2022-05-10.
ImageResizer settings and trace files are extracted to ImageResizerLib project, to be able to consume those both from Ext and ContextMenu projects.
As CreateProcess can't run new proces from packaged app (sparse package here), PowerRename and ImageResuzer are being ran with explorer as parent process. Therefore, additional logic is added to use named pipes in that case (comparing to default stdin anonymous pipes when standard context menu is used).
Validation Steps Performed
powershell -c get-appxpackage -name *imageresizer*