Scoop-extras: powertoys: Add registry keys for context menu

Created on 2 Nov 2019  路  6Comments  路  Source: lukesampson/scoop-extras

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.

Most helpful comment

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.

All 6 comments

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.

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

This also affects "Image Resizer".

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lepicsaintloup picture lepicsaintloup  路  10Comments

rasa picture rasa  路  8Comments

lx4r picture lx4r  路  8Comments

janpio picture janpio  路  13Comments

Bazalia picture Bazalia  路  13Comments