notepad-plus-plus / npp-usermanual

Notepad++ User Manual

Home Page:https://npp-user-manual.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Shell Extension" section

victorel-petrovich opened this issue · comments

commented

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.

commented

But , after copying NppShell.dll inside the Portable version (of same version, 8.5.4) folder, trying to run regsvr32 /i NppShell.dll leads to error
loadedButEntryPoint_DllInstall_notFound

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

commented

I understand. I added the details to explain why the manual needs change there.

commented

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.

image

commented

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

commented

@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)

commented

@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.

@victorel-petrovich ,

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: Call DllInstall(TRUE,[cmdline]) to install the DLL. If the install was successful also call DLLRegisterServer.

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

  1. Link from Shell Extension to Explorer Right-Click Menu
  2. Add the non-/i version of the DLL register command
  3. Emphasize the need for administrative privileges to register the DLL
  4. Note that around v8.5.1, they dropped the _## suffix from the name and moved it into contextMenu\ subfolder, so it's just NppShell.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.

commented

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.

commented

@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++"