ScoopInstaller / Extras

📦 The Extras bucket for Scoop.
https://scoop.sh
The Unlicense
1.8k stars 1.38k forks source link

powertoys: Add registry keys for context menu #4937

Closed graphixillusion closed 4 weeks ago

graphixillusion commented 5 years ago

Hi there. I just want to report that if you install powertoys with scoop, the new module's option "PowerRenamer" doesn't appear in the right click context menu as it should. I think there is something wrong in how scoop manages this installation becouse the standard msi file doesn't have this issue.

ianharmon commented 5 years ago

The installer makes some registry changes that Scoop doesn't, I tried finding what these are and this seems to be sufficient:

To register the context menu item (requires variable substitution for the scoop directory, and admin rights):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\PowerRenameExt]
@="{0440049F-D1DC-4E46-B27B-98393D79486B}"

[HKEY_CLASSES_ROOT\CLSID\{0440049F-D1DC-4E46-B27B-98393D79486B}]
@="PowerRename Shell Extension"

[HKEY_CLASSES_ROOT\CLSID\{0440049F-D1DC-4E46-B27B-98393D79486B}\InprocServer32]
@="%SCOOP%\\apps\\powertoys\\current\\modules\\PowerRenameExt.dll"
"ThreadingModel"="Apartment"

To make the context menu item show up for the current user:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\PowerRename]
"Enabled"=dword:00000001

I didn't do a deep dive on any registry changes it may have made, but when I ran the uninstaller it seemed to clean up after itself, so hopefully this is all that's needed.

As far as adding this to the Scoop version, someone could probably do it like vscode's manifest does.

ianharmon commented 5 years ago

I played around with this a bit more and it seems HKEY_CURRENT_USER\Software\Classes works in place of HKEY_CLASSES_ROOT, which seems better for non-global installs since it doesn't require admin privileges.

So those three keys could change based on whether it's global, and the Enabled key can remain as-is, and if other users need to enable the context menu, they can do it in the app's UI.

Here's my proposed changes, minus changing the URLs of the two .reg files: https://github.com/lukesampson/scoop-extras/compare/master...ianharmon:powertoys

e: moved to its own branch and opened a PR: https://github.com/lukesampson/scoop-extras/pull/3257

JanPokorny commented 4 years ago

This also affects "Image Resizer".

ghost commented 4 years ago

https://github.com/microsoft/PowerToys/issues/636 ,The method of registry has become invalid , it may have no solution for this.

JanPokorny commented 4 years ago

As there are currently no plans to do a portable version (https://github.com/microsoft/PowerToys/issues/598#issuecomment-569778927), I propose creating powertoys-np in the https://github.com/TheRandomLabs/scoop-nonportable bucket: https://github.com/TheRandomLabs/scoop-nonportable/issues/154

JanPokorny commented 4 years ago

Thanks @TheRandomLabs for a working non-portable manifest! https://github.com/TheRandomLabs/scoop-nonportable/blob/master/bucket/powertoys-np.json

As some toys from PowerToys are usable in the portable mode too, it makes sense to me to leave them in the extras bucket and just place a note: https://github.com/lukesampson/scoop-extras/pull/4181

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.