Community
    • Login

    Incorporating SaveAsAdmin's handling into N++'s

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 2 Posters 2.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Eagle3386E
      Eagle3386
      last edited by

      Hey community,

      editing a given file sometimes requires elevated permissions due to the file’s protected location (e. g. C:\Program Files\Notepad++\change.log) and N++ can handle this, of course.

      But IMHO, there’s a small, yet important, downside with the current implementation: all editing done prior to confirming the launch in Administrator mode is simply lost.
      The reason behind is that N++'s newly created admin-instance opens the file once again instead of reading edited contents from the “parent” instance.

      Installing SaveAsAdmin plugin solved this before N++ x64 launched.
      And I tried my best to get the plugin working with on x64, but I don’t understand C++ good enough to succeed.

      From what I do understand, SaveAsAdmin seems to launch a non-windowed “sub-program”, pass in edited contents via pipe and the sub-program (with elevated permissions for itself) then writes the file’s contents to disk.

      So, can N++ kind of incorporate SaveAsAdmin’s way of dealing with such files? Maybe by passing the contents to the admin-instance, too?

      Any help would be greatly appreciated!

      Kind regards,
      Martin

      1 Reply Last reply Reply Quote 1
      • chcgC
        chcg
        last edited by

        @Eagle3386 You may want to test this https://github.com/chcg/nppSaveAsAdmin/releases/tag/1.0.0.3.9. Just a rebuild of the sourceforge repo with adaptations to x64. I will also add it to the x64 pluginManager list, if it is working fine for you.

        1 Reply Last reply Reply Quote 1
        • Eagle3386E
          Eagle3386
          last edited by

          @chcg, awesome work - thanks mate! 👍

          Some suggestions, though:

          • either keep the 4-digit versioning scheme known from the .NET framework, i. e. change it to “1.0.0.4” or maybe even “1.0.1.0” due to the added build of a x64 version or switch to (IMHO better) semantic versioning, i. e. release it as version “1.1.0”
          • add yourself as a author within the about dialog and credits as “credit where credit is due” :)
          • change the version display of “a,b,c,d” to the common “a.b.c.d”

          If you want, I’d happily fork it on GH and provide you with a PR - just drop me short line. :)

          1 Reply Last reply Reply Quote 2
          • Eagle3386E
            Eagle3386
            last edited by Eagle3386

            @donho since the resulting NppAdminAccess.exe is (and can) not be signed with N++'s official certificate, I’d like to know if you can incorporate @chcg’s provided code in order to have less technical educated N++ users getting a “valid” UAC prompt from Windows instead of the yellow “do you really trust this app” one.

            @all: what do I need to do to receive the 2nd reputation point in order to not be forced to wait 20 minutes between each reply anymore?

            1 Reply Last reply Reply Quote 0
            • Eagle3386E
              Eagle3386
              last edited by

              @Claudia-Frank, thanks for helping me overcoming the “penalty”! ☺️

              1 Reply Last reply Reply Quote 0
              • chcgC
                chcg
                last edited by

                @Eagle3386 The dll version is still 1.0.0.3. As this is just a rebuild without any functional change and I’m not planning to extend or further modify it. So keeping it as is for now.

                1 Reply Last reply Reply Quote 0
                • Eagle3386E
                  Eagle3386
                  last edited by

                  @chcg, while I disagree regarding functional change as support for x64 is introduced, I’m also deeply thankful for your rebuilt.

                  Hence, I’ll consider this solved and would love to see it available in plugin manager(s) for x64 soon. :)

                  1 Reply Last reply Reply Quote 0
                  • chcgC
                    chcg
                    last edited by

                    Available now with https://github.com/bruderstein/npp-plugins-x64/commit/516deb6cbb5d63910fdd18d33af82ccce92d4319

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors