"Shell Extension" section
victorel-petrovich opened this issue · comments
Suggest some changes for clarity
1. Change title to "Context-menu Entry" ?
(I've only accidentally opened that section, and found out about that goodie).
2. Clarification on where to find the extension in case of portable version. This sentence:
To manually install the DLL (which resides in your Notepad++ installation folder), use regsvr32 /i NppShell_01.dll
Appears to be intended for Portable version, or at least for both Portable and Installer, no ? If so, where can they find that NppShell_01.dll ? Unlike in Installer version, a contextMenu folder is not present.
After reading https://community.notepad-plus-plus.org/topic/20564/context-menu-entry-in-the-potable-version-of-notepad/18 ,
I managed to extract the installer (.exe), using 7z, then found inside folder "contextMenu" with NppShell.dll
inside.
I could make a pull request myself.
The procedure in the Manual is the procedure I was given by the developers. If the procedure they have defined doesn't work, you will have to put an issue in the main application issues section, because I have no insight into what the actual procedure might be, or it might be that you've found a bug. Either way, we cannot fix procedures or bugs in the manual -- we just document what it's supposed to do, to the best of our knowledge
I understand. I added the details to explain why the manual needs change there.
According to @GurliGebis notepad-plus-plus/notepad-plus-plus#13439 (comment)
the command would be regsvr32.exe NppShell.dll
(note the lacking /i
) and that works.
Submitted issue on including the extension inside portable version: notepad-plus-plus/notepad-plus-plus#13935
If I recall correctly, it default to /i implicitly if nothing is passed
@GurliGebis the pictures above don't lie. On this platform:
Notepad++ v8.5.4 (32-bit)
Build time : Jun 17 2023 - 20:40:14
Path : C:\Users\Vic\Downloads\editors\npp.8.5.4.portable\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 7 Ultimate (32-bit)
OS Build : 7601.24546
Current ANSI codepage : 1252
Plugins :
mimeTools (2.9)
NppConverter (4.5)
NppExec (0.8.4)
NppExport (0.4)
PythonScript (2)
@pryrt , I read this subsection https://npp-user-manual.org/docs/other-resources/#explorer-right-click-menu , which has same intent as Shell Extension.
What do you think of merging it in the Shell extension section, except renamed "Explorer Right-Click menu" or "Explorer Context Menu" or similar?
This way, users for which the NppShell.dll won't work, will read ahead the .reg file approach.
What do you think of merging it in the Shell extension section
There are too many links out there to that specific page to get that specific information. I could add a link from the Shell Extension page to the "Explorer Right-Click Menu" section.
Regarding /i
vs no-/i
, the ss64.com description of regsvr32 (which is more detailed than the MS docs) does distinguish between default behavior and /i
behavior:
default: With no other options: Register server by calling
DLLRegisterServer
.
/i
: CallDllInstall(TRUE,[cmdline])
to install the DLL. If the install was successful also callDLLRegisterServer
.
So the default behavior just registers the DLL; /i
installs it first then registers it.
And regsvr32
is expected to require elevated privileges.
As a result, it would make sense to supply both choices to users, so that they can use the flag that's appropriate for their machine (or have both to try, since for some the /i
version worked, even though it didn't for you)
To sum up: as a result of this issue, I will
- Link from Shell Extension to Explorer Right-Click Menu
- Add the non-
/i
version of the DLL register command - Emphasize the need for administrative privileges to register the DLL
- Note that around v8.5.1, they dropped the
_##
suffix from the name and moved it intocontextMenu\
subfolder, so it's justNppShell.dll
As you can see from my PR, I actually changed my mind. I decided to do the merge from "Other Resources > Explorer Right-Click Menu" to "Shell Extension > Alternatives" -- I was able to figure out a way to make sure all old links to the Other-Resources version will still resolve in that document, and then they can click to get to the new location.
Very good insights and changes!
Since pages elsewhere that linked to "Shell Extension" would still be directed to https://npp-user-manual.org/docs/shell-extension/ without harm,
and the NppShell.dll is only one of the ways to get the right-click functionality,
I'd choose to still rename the page to "Right Click Context Entry",
then make the first subsection in that page named "Shell Extension" (header ##), with the subsections there in the commit up to "Alternatives" be made one level deeper, correspondingly.
But I won't insist on this if you don't agree.
Feel free to close this issue when you think it's done.
@pryrt
One more thing!
Let's improve there the .reg
script for adding the "Edit with Notepad++" to add an icon as well (because it's so much nicer ) .
Based on scripts on https://npp-user-manual.org/docs/other-resources/#explorer-right-click-menu and the suggestion in https://community.notepad-plus-plus.org/topic/18140/how-to-get-windows-explorer-right-click-menu-open-edit-with-notepad?_=1690587272509 , which I've tested on my system w/ Portable, as non-admin user (with right path change),
and is also similar to another recomendation online , it just needs this new line:
"Icon"="C:\\Program Files\\Notepad++\\notepad++.exe,0"
to be placed in those scripts right under the line:
@="Edit With Notepad++"