Closed donho closed 1 year ago
I'm 99,9% sure I know what the issue is. When installing the 32bit version on Windows 11, which is 64bit, the msix is not installed.
But registering the dll on Windows 11 tries to register the sparse package (like it should), which will fail.
I will include it in the installer changes PR I do later, then it should "just works"
Hi, I posted about this with a solution for those using the legacy context menu on Win 11 here
I am using the 64 bit version of notepad++
@chip33 like mentioned there, there is a bug in the current release that prevents it from working. My PR in there should fix it - I will test it once it is merged and let you know
@GurliGebis
When installing the 32bit version on Windows 11, which is 64bit, the msix is not installed. But registering the dll on Windows 11 tries to register the sparse package (like it should), which will fail.
v8.5.1 32bits installer on Windows 11 works fine - thanks to the following code
${If} $WinVer == "11"
; Clean up the hack of v8.5 installer
ReadRegStr $muiVerbStr HKLM "SOFTWARE\Classes\*\shell\pintohome" MUIVerb
${StrStr} $nppSubStr $muiVerbStr "Notepad++"
; Make sure there's an entry, and the entry belong to Notepad++ before deleting it
${If} $muiVerbStr != ""
${AndIf} $nppSubStr != "" ; it contains "Notepad++"
DeleteRegKey HKLM "SOFTWARE\Classes\*\shell\pintohome"
${EndIf}
; Install the new Windows 11 "Edit with Notepad++" menu entry
!ifdef ARCHARM64
File /oname=$INSTDIR\NppModernShell.msix "..\binarm64\NppModernShell.msix"
File /oname=$INSTDIR\NppModernShell.dll "..\binarm64\NppModernShell.dll"
!else ; !ifdef ARCH64
File /oname=$INSTDIR\NppModernShell.msix "..\bin64\NppModernShell.msix"
File /oname=$INSTDIR\NppModernShell.dll "..\bin64\NppModernShell.dll"
!endif
Exec 'rundll32.exe "$INSTDIR\NppModernShell.dll",RegisterSparsePackage'
; Make sure old NppShell dll's are unregistered and removed
...
${Else}
I just tested it and we need only to restart OS (or explorer) to make the entry appears.
This issue is rather for eliminating the "restarting explorer" procedure - it will be a (VERY) NICE TO HAVE enhancement.
@donho ahh yes. That issue is fixed in the next dll, so as soon as you merge it and build an installer, I'll test it 😃
@GurliGebis
That issue is fixed in the next dll, so as soon as you merge it and build an installer, I'll test it 😃
By "That issue" you means "restarting Explorer to make Edit with Notepad++" appear, right?
Yes @donho, just need a new installer with my PR against this repo, with a new built dll
@donho this might be a good test case for TEST5 😀 agree?
Not sure if this is right place to report problem with NppShell, but in my environment, 'Open with Notepad++' context menu doesn't appear even after PC restart.
I updated NPP from v8.5 to v8.5.1 and found out that the context menu was gone. So after reading this issue, I rebooted my PC. But the context menu is still missing.
I even tried to register the DLL manually by running this command in Command Prompt with admin priviledge but it failed.
regsvr32 NppModernShell.dll
The error message was about 'entry-point DLLRegisterserver was not found'.
This kind of workaround worked with Mp3Tag which uses similar approach with context menu (.msix
and .dll
) and I wonder if this is related to this issue or not.
If not, I'm willing to post new issue about this.
I'm not sure if this is related to using StartAllBack which brings back old context menu.
But manually re-registering context menu of Mp3Tag worked even with old context menu so I think this is NppShell problem.
@TetraTheta there are several issues with the 8.5.1 implementation. We are working on fixing it for the next release.
@donho lets try with TEST9 and see if it works. @TetraTheta can you try and see if it works with this test version? http://download.notepad-plus-plus.org/repository/MISC/nppShell.TEST09/
@GurliGebis Tested with npp.8.5.1.Installer.x64.exe
and unfortunately, it didn't work.
I tried:
I don't see any DLL or MSIX file in NPP install destination. Are you sure NppShell is included in TEST09 setup file? Those files are located under contextmenu
directory. I missed it, sorry!
Manually registering NppShell.dll
doesn't throw error (registered successfully) but the context menu is still missing.
@TetraTheta is it a modified Windows 11 installation? (like some services removed or disabled)
@TetraTheta also, if you run this command in powershell, what does it give you?
Get-AppxPackage -Name NotepadPlusPlus
@GurliGebis I use a modified version of Windows 11, but that wouldn't cause a problem with the context menu because I didn't remove any services while doing that. Â Also, as I mentioned before, I had no problem registering Mp3Tag's context menu both automatically (by the installer) and manually with this modified Windows 11.
Here is the output of running Get-AppxPackage -Name NotepadPlusPlus
command in PowerShell.
Name : NotepadPlusPlus
Publisher : CN="Notepad++", O="Notepad++", L=Saint Cloud, S=Ile-de-France, C=FR
Architecture : Neutral
ResourceId :
Version : 1.0.0.0
PackageFullName : NotepadPlusPlus_1.0.0.0_neutral__7njy0v32s6xk6
InstallLocation : C:\Program Files\WindowsApps\NotepadPlusPlus_1.0.0.0_neutral__7njy0v32s6xk6
IsFramework : False
PackageFamilyName : NotepadPlusPlus_7njy0v32s6xk6
PublisherId : 7njy0v32s6xk6
IsResourcePackage : False
IsBundle : False
IsDevelopmentMode : False
NonRemovable : False
IsPartiallyStaged : False
SignatureKind : Developer
Status : Ok
I also tested TEST10, but that didn't register the context menu either.
If I'm the only one who experiences this, I will just resort to the old way of adding context menus, which messes up the registry.
@TetraTheta what kind of modifications have you done to it? It is strange Mp3tag works, since they do it the same way as far as I know.
@GurliGebis I just removed some unwanted stuff like Windows Maps, Windows Media Player, etc. I didn't touch the services because I don't know them well. That also applies to library stuff.
Yeah, it is very strange that Mp3Tag works but NPP doesn't.
Mp3Tag seems to be closed-source, so I can't tell the difference between Mp3Tag's implementation and NppShell's, not to mention my inexperience with this kind of stuff.
@TetraTheta not sure if it makes any difference, but can you try with http://download.notepad-plus-plus.org/repository/MISC/nppShell.TEST10/ ?
@GurliGebis I've already tested it
I also tested TEST10, but that didn't register the context menu either.
Is there any difference between that time and now?
Only from the installer point of view
I re-downloaded the TEST10 installer just a moment ago and installed it. Â
I restarted the Windows Explorer process (explorer.exe
), and no context menu was present. Â
I rebooted my PC, but still no context menu was present.
Manually registering it also doesn't work.
At this point, I'm really not sure if it's just me who has this problem or if other people are also experiencing it.
@TetraTheta can I get you to try using the Windows Sandbox feature, and installing it inside there. It is a lightwigth, buildin VM based on your installation, so it would be interresting to see if the issue is also in there.
@GurliGebis I could get the context menu inside Windows Sandbox both 'modern context menu' and 'classic context menu'.
It was my problem that the context menu didn't showed up. Thanks for the help!
@TetraTheta So could you confirm that TEST10 doesn't work for you due to your special configuration? Could you elaborate more about your configuration?
If I know right, Windows Sandbox only puts apps and components that MS has allowed (whitelisted) into its sandbox environment.  I removed MS Edge completely because I don't use it at all. It is different from the MS Edge WebView2 Runtime, so it can be removed without causing problems for the OS. Almost every component that uses WebView would use WebView2 Runtime instead of MS Edge.  My sandbox environment didn't have MS Edge because my OS didn't have it, so it wasn't copied into the sandbox environment.
Since MS Edge wasn't included in Windows Sandbox, I can assume that Windows and its removed components were not the cause of the problem I have. If the removed component was the cause of the problem, NppShell wouldn't be registered correctly, so no context menu would show up in the Windows Sandbox environment.
So I think the software I've installed is the cause of the problem. Perhaps the registry was corrupted, or perhaps some other software prevents NppShell from being properly registered or from appearing. I can't test it because testing it would require me to reinstall the entire OS again, and I don't want to do it now.
So yes, I would say that it was my configuration that caused NppShell to not register correctly. I don't know what caused this issue and can't test it until I reinstall the entire OS.  If you need more information, feel free to ask me about it. I will help as much as I can if it doesn't mess up my daily use of my environment.
@TetraTheta Thank you very much for your very detail information!
@donho can you mark this issue as closed?
After installing v8.5.1 under Widows 11, users have to restart Explorer or OS to make "Edit with Notepad++" exploer context menu appear.
Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13399