Closed dodmi closed 2 years ago
Hi. I was sure that they gonna add embedded feature in NPP, especially after I broke NPP with https://github.com/Hsilgos/nppsaveasadmin/issues/24 I'll have a look int new API, thanks for reporting
That would be really kind. Thank you.
@dodmi , I tried to reproduce and failed. I have:
I tried both x64 and x86 versions. Please describe your setup.
Also I checked changes in Notepad++ which you mentioned and they look compatible with plugin.
Well, that's strange. Actually I just realized, it seems to work in general, but not with the hosts file. I have
Trying to change 'C:\Program Files (x86)\Notepad++\change.log' for example raises 'NppAdminAccess.exe' as expected with both Notepad++ 8.1.5 and 8.2. Trying to change 'C:\Windows\sysnative\drivers\etc\hosts' works with Notepad++ 8.1.5 but triggers the default Notepad++ behavior in later versions (also in 8.2). This seems to be not working for all files accessed via 'C:\Windows\sysnative\'. Please note, that sysnative is a special virtual path, which is provided on x64 systems to allow x86 applications to access files in 'C:\Windows\system32' as default calls to 'C:\Windows\system32' are redirected to 'C:\Windows\SysWOW64'.
@Hsilgos Were you able to reproduce the issue or do you need more information?
@dodmi , yes, I understand the issue... But this scenario doesn't work for me in Npp at all... Here is my steps:
Notepad++ C:\Windows\sysnative\drivers\etc\hosts
I try with x86 Notepad++ 8.2 and 8.2.1 on x64 Win10 Pro.
Can you confirm that Notepad++ works for you in the same scenario? (I'll be very surprised because I didn't find requered calls to Wow64EnableWow64FsRedirection() / Wow64DisableWow64FsRedirection() ) in the Npp code during the save...
@Hsilgos Ok, actually I didn't try to save the file after Notepad++ reopened as admin (as all changes were lost). I upgraded again to test and can confirm, the behavior is exactly the same here. Trying to save hosts file, when Notepad++ is running as admin will trigger another error, that the file couldn't be saved. I can also confirm, that it is working flawlessly with Notepad++ 8.1.5 x86 and NppSaveAsAdmin, as I used this setup to make the changes (and older versions).
So is this a Notepad++ issue and you can't do anything about it?
@dodmi , well... I may try to kind of "fix" the issue directly in my plugin... But actually it must be reported to Notepad++. Report the issue in their repo, may be I'll have a look at it and will try to fix it in Notepad++ if no one takes care of it :)
I've opened an issue at Notepad++: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11196
The issue was fixed in Notepad++, so I'm closing this issue. Thank you for your help.
Couldn't save a simple txt file to C:\Program Files (x86)\delete.txt then prompted to save in Documents instead. Sorry it doesn't work anymore. :( v8.6.3 64bit Version: 1.0.211
Hi, I just encountered a problem, that NPPSaveAsAdmin isn't working anymore on latest Notepad++. I had to downgrade to Notepad++ 8.1.5 (32bit). With later versions, UAC isn't triggered anymore on saving a file.
I guess, the root cause is the change in the file saving api in version 8.1.6: https://notepad-plus-plus.org/news/v816-released/
Can you please provide a fix?