[Feature request] Installation as local user (with admin privileges)
Is there an existing issue for this?
- [X] I have searched the existing issues
Description of the Issue
Currently, installation of Notepad++ requires access rights elevation (i.e. running as admin user) and sparks a UAC prompt. This requires that the admin first of all trusts the installer, but also prevents installation for users without admin rights. Running a portable version is not a good workaround, as it limits the capability of swift security updates and lacks explorer (right-click) integration.
There were some similar feature requests in the past, but I think it is time to revisit: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/388 https://github.com/notepad-plus-plus/notepad-plus-plus/issues/3425
I believe today the stance has changed so that app installations on a per-user level are a common thing. Especially since Microsoft Store with its app became more famous and moreover with the launch of Windows Package Manager (a.k.a. winget) and its success among users allowing a user install of Notepad++ is a valid request.
Describe the solution you'd like.
I am not exactly sure what options NSIS offers, but I can think of the following solutions:
- commandline switch
- spawn UAC prompt and fall back to per-user install if no elevated privileges are granted
Generally, per-user installs should go into %LocalAppData%\Notepad++
Debug Information
(none)
Anything else?
No response
After many years using Notepad++ and recommending it to lots of people, I will stop using it. The need of Admin Rights in Windows is absolutely a no-go. So many years, no answer, nothing done. Sorry, but this is just an text editor. Admin rights for a text editor is really not in line with the current times.
@jromal
Use portable version, placed in a folder location that requires no special "rights"?
@alankilborn no. Portable version is uncomfortable to update and most importantly, it lacks context menu integration! Somebody 1 or 2 years ago published a version to Microsoft Store and it worked great. Unfortunately, Notepad++ had it removed from the store. Now that I got a new computer from work I can't install it anymore from the store and thus can't use Notepad++ anymore. And I don't want to ask IT department anytime there's an update to Notepad++.
@jromal can you suggest any good alternative?
https://nsis.sourceforge.io/Reference/RequestExecutionLevel
Using none or user in the N++ installer source NSIS-script could do.
But the problem probably will be the possible installation of the NppShell extension (I did not test, maybe it could be now per-user too, IDK).
I will try to play with it but I am afraid that any such attempt could only end up with making an additional version of the installer published, which is a no-go.
Portable version is uncomfortable to update
Well, you want something special, so it needs some effort from your side. It is doable e.g. via PythonScript (Upgrading notepad++ with one click. ) or simply using a package manager service like the MS WinGet.
Portable version ... it lacks context menu integration!
You can extract it (e.g. 7-Zip app can unpack the NSIS-installers) from the installer (look there for the contextMenu subfolder) and register it manually (regsvr32 NppShell.dll at cmdline) even for the portable version (I do not recommend that but as you wish).
@alankilborn no. Portable version is uncomfortable to update and most importantly, it lacks context menu integration! Somebody 1 or 2 years ago published a version to Microsoft Store and it worked great. Unfortunately, Notepad++ had it removed from the store. Now that I got a new computer from work I can't install it anymore from the store and thus can't use Notepad++ anymore. And I don't want to ask IT department anytime there's an update to Notepad++.
@jromal can you suggest any good alternative?
I fully agree. It is not the same a portable version (without updates) and the real thing.
Currently I am tending to use VSCode, even if it is too big for most of the things and it is "monitored" by Microsoft. But at least you can install it anywhere without asking the IT department.
I do not want alternative ways to install. I want to know:
- why does it need admin rights for installation?
- What are the features that require it and cannot be implemented otherwise?
- Why there is no option to have a version without those features that does not required elevated privileges?
It looks like a program that has lost the contact with the reality.
- What are the features that require it and cannot be implemented otherwise?
None. As I mentioned, there used to be an (unofficial) version published on Microsoft Store 1 or 2 years ago and it was working flawlessly.
I will try to play with it but I am afraid that any such attempt could only end up with making an additional version of the installer published, which is a no-go.
I don't think that would be an issue. There are several apps on the winget repo that have a separate version for per-user installs. Although I agree it would be cleaner to manage this within one single installer.
Typically I know this from installations where the script asks "this user only" or "all users". I don't know if the N++ installer supports this.
You can extract it (e.g. 7-Zip app can unpack the NSIS-installers) from the installer (look there for the
contextMenusubfolder) and register it manually (regsvr32 NppShell.dllat cmdline) even for the portable version (I do not recommend that but as you wish).
Why don't you recommend this?
I don't know if this will just work on no-admin accounts but I will give it a try! In general this is possible, though. Other apps make use of it. E.g. NanaZip - a fork of 7zip on the MS store - has perfect context menu integration on user-only installs without admin.
I tried the manual registration of shell extensions but it didn't work. I also have no idea how the registration should know to where I unzipped N++.
@treysis
I also have no idea how the registration should know to where I unzipped N++.
Ah, I forgot to add:
-
put the
contextMenusubfolder with the NppShell stuff to your portable main N++ folder (relevant NppShell source code): -
register/unregister it (but for that you will need the admin rights, so no per-user shell extension for now, as I expected):
Why don't you recommend this?
It is complicated and I do not have time to explain, sorry.
@xomx Ok, got it working. The important part was to run the command from the parent folder of the notepad++.exe: regsvr32.exe .\contextMenu\NppShell.dll). Doesn't require admin rights. I now have it in my right click context menu.
While I still think N++ should be converted to user-only installation by default, this is certainly a neat workaround that will make it easier at least for me.
If I can craft an installer that does a user-only install, would you be interested in publishing it?
@treysis
Doesn't require admin rights. I now have it in my right click context menu.
Ok, I can confirm that the N++ shell context menu is there after registering W/O admin rights (I have to restart my filemanager app used after that registration to see the menu, logoff/logon can help too in such a situation).
But there is a problem - when you run the cmdline regsvr32 NppShell.dll, you should obtain this message from the regsvr32 (if you do not use the /s - silent mode switch):
But this is not the case without the admin rights - I am not getting such msg. The registration is done somehow & works but there remains a "zombie" regsvr32.exe process visible in the TaskManager without any active thread but still with some resources allocated. This looks to me as a bug in the NppShell project.
If I can craft an installer that does a user-only install, would you be interested in publishing it?
This is not a question for me, but for this project maintainer.
Basically there needs to be the option that Admins can tun on or off for user to be able to install plugins in a user context.
If an Admin doesnt want this to be allowed then they should be able to turn off and manage the plugins manually. But there should be the option.
If an Admin doesnt want this to be allowed then they should be able to turn off and manage the plugins manually. But there should be the option.
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14277#issuecomment-1782563875
With no updater folder, no Plugins Admin... for the users:
https://nsis.sourceforge.io/Reference/RequestExecutionLevel
Using
noneoruserin the N++ installer source NSIS-script could do. But the problem probably will be the possible installation of the NppShell extension (I did not test, maybe it could be now per-user too, IDK).
So I finally tried:
-
noneis unfortunately a no go, as the Windows OS automatically identifies (sigh) all the NSIS installers and decides that the admin privileges will be required anyway, sononeandadminthen have virtually the same effect here... -
with
user, there is not the starting UAC-prompt (good) but then a similar stuff is evidently missing later in the current installer source code state:
I will try to play with it but I am afraid that any such attempt could only end up with making an additional version of the installer published, which is a no-go.
I think I should be able to re-code the unified installer so that it doesn't automatically require the admin rights at the very start, but then, if the user chooses to install in to a protected storage location, to fire-up dynamically the UAC-prompt and relaunch. But low spare time so no promises here.
This is causing issues with my new "no admin access" work laptop sadly.. I was able to get workarounds for almost every other application except this one, including availability in MS store or the installer working properly and not requiring admin access. Hope we can get this soon!
@ependergrass
get workarounds
Meanwhile (I'm currently busy elsewhere and don't see any opportunity to devote myself to this in the near future), using the portable N++ versions (e.g. npp.8.8.3.portable.x64.zip) instead of the installed ones isn't a solution for you?
@xomx does it have context menu integration, or not? That's the reason why I mostly stopped using Notepad++.
@treysis , I'm curious, what's the big deal with context-menu integration, that "Edit with N++" thing? Once you use "Open with..." and associate to use N++ to open a particular filetype, then just double-click. How often do you need to open a file not set to be default w/ N++? In those cases, "Open with" is only a few more clicks/press keys away from "Edit w/ N++". Besides, that integration is still possible to do for Portable; just a bit more manual setup.
@victorel-petrovich Yes. Unfortunately, in our corp environment, I don't have too much control over file type associtations and they seem to get reset from time to time. Also, most of the time even N++ is overkill and I prefer the tab-less MS Notepad. Also, sometimes I have special software project files that I might want to edit but by default should launch the special application.
My environment might be a special case. Not sure. However, I don't have control over those things, whereas it would be relatively easy to integrate those settings into N++.
For now, I have switched to using VS Code instead, which doesn't have these issues that N++ does (and it was also a simple non-admin user install).
@treysis shouldn't the title be "Installation as local user (without admin privileges)" ?
@Will-EML
Basically there needs to be the option that Admins can tun on or off for user to be able to install plugins in a user context.
IMHO, that's way too much power over users. What goes into "user context" should be user's business. Also futile, because users can install the portable and could all the plugins they want anyway.