Skip to content

Save dialog should correctly elevate privileges (UAC) #9561

@mere-human

Description

@mere-human

Description of the Issue

I would like to be prompted with UAC dialog when saving a new file or saving a modified existing file in a protected location that requires administrator rights.

Steps to Reproduce the Issue

I. New file:

  1. Create a new file
  2. File > Save as...
  3. Navigate to any directory that requires administrator rights to write (e.g. C:\)
  4. Press Save button

II. Modified file:

  1. File > Open
  2. Select a file that is located in a directory that requires administrator rights to write
  3. Modify a file (add some text)
  4. File > Save

Expected Behavior

UAC dialog appears asking for permission to save:
image

Actual Behavior

I. New file:
image
It suggest you to save in the documents folder without an option to save as administrator.

II. Modified file:
image
It tries to launch a program as administrator.
A side effect of that is all new modifications are lost.
This was mentioned before:
#4873
#8655

Debug Information

Notepad++ v7.9.3 (64-bit)
Build time : Feb 22 2021 - 22:47:45
Path : E:\Development\notepad-plus-plus\PowerEditor\visual.net\x64\Unicode Debug\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 2009
OS Build : 19042.804
Current ANSI codepage : 1252
Plugins : none

Details

There is a plugin that solves this problem NppSaveAsAdmin
However, in version 7.9.3 it stopped working.
In the discussion, it was suggested to incorporate such a functionality into the Notepad++ itself:
Hsilgos/nppsaveasadmin#24 (comment)

Also, UAC is supported starting from Windows Vista.:
https://en.wikipedia.org/wiki/User_Account_Control
Starting from version 7.9.3, Notepad++ isn't supported on the Windows XP.
This makes it possible to implement UAC properly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions