-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NppShell.dll is not released after N++ uninstall #66
Comments
OK, some more info. |
There is no safe way to unload a DLL from explorer (except terminating the process) - so there isn't really anything we can do. |
Is it possible that NppShell.dll keeps opened some resources/handlers which block it from unloading when |
No, but like I said, there is no safe way to unload it from explorer.exe . |
So explorer even is not trying to unload it on |
I did try to add it, the only thing that happens if you try to unload it, is that explorer.exe will crash (due to the thread running the code dying), so 🤷♂️ |
The only thing that does is just call a function inside the DLL - we would have to implement it ourselves - it doesn't do anything for us, except call a function. |
How about to let the DLL know to be aware of new N++ location? It's only a guess, because I don't know the architecture. |
I don't see how that would unload the DLL from the explorer process? |
I mean, keep the dll loaded, but make it work with new N++ location. |
So you are installing notepad++ to a new location, when you are upgrading? |
I'm not. Just reinstalling: uninstall then install again. |
Then the location is the same? When the installer updates, it moves the old version away and places the new version in it's place. |
No. New location is changing. I was testing the issue like this:
Right now I'm not sure if an old dll is removed or left alone, but the issue is there is no way to unload the dll and load new dll to let it know about new location of N++. My suggestion was to let loaded dll know about the new location of N++. (FINAL edition v1 ;) |
When you install it, it gets registered in the new location, so it should be loaded from there going forward. Why do you want to tell the loaded DLL about the new install location? |
To make |
That makes sense, since it uses it's own path to find the npp exe. |
Regsvr does not unload anything in other processes, it usually just edits the registry. Shell extensions can be unloaded in theory when DllCanUnloadNow says so but for this to happen, something inside Explorer has to trigger a call to CoFreeUnusedLibraries and I don't think there is a message you can send to trigger this. |
While investigating notepad-plus-plus/notepad-plus-plus#15892 I found NppShell.dll is not released after N++ uninstallation, and after a fresh installation in e.g.
c:\Program Files
RMB Explorer contex menu is not working because old dll is loaded like so:Running
regsvr32.exe /s /u ...
as admin also didn't help.The text was updated successfully, but these errors were encountered: