Community
    • 登入

    New 7.9.3 (x64 standard e portable) It will not start

    已排程 已置頂 已鎖定 已移動 General Discussion
    11 貼文 5 Posters 668 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Claudio RenièC
      Claudio Reniè
      最後由 編輯

      The installation 7.9.3 apparently seems to complete positively (even if it does not appear selected, then the chosen language in translation …) while at the next start, both in Windows 7 x64 and in windows 10 20h2.804 (operating OS and VM clean) via start menu and / or link does not start me.
      Equally with the .zip version as well as .7z portable.
      Excuse my English (as a translator) LOL

      dinkumoilD 2 條回覆 最後回覆 回覆 引用 1
      • dinkumoilD
        dinkumoil @Claudio Reniè
        最後由 編輯

        @Claudio-Reniè

        Do you have installed the NppSaveAsAdmin plugin? Npp v7.9.3 crashes at startup if this plugin is installed. I already filed an issue in the plugin’s repo.

        1 條回覆 最後回覆 回覆 引用 3
        • Claudio RenièC
          Claudio Reniè
          最後由 編輯

          Ok I confirm that was the problem (it was enough to delete this plugin from the ./plugin/ folder. Thanks.

          However, I understand that until the “Save as Admin” plugin is updated there is no possibility to save as Administrator …?

          EkopalypseE 1 條回覆 最後回覆 回覆 引用 0
          • EkopalypseE
            Ekopalypse @Claudio Reniè
            最後由 編輯

            @Claudio-Reniè

            one option would be to run npp as administrator, but that raises other issues, such as not being able to drag and drop files from unprivileged other processes.

            1 條回覆 最後回覆 回覆 引用 2
            • Claudio RenièC
              Claudio Reniè
              最後由 編輯

              ok. thank you all

              1 條回覆 最後回覆 回覆 引用 0
              • ChelOisC
                ChelOis
                最後由 編輯

                Same problem here, and same solution too. :)
                Thanks for the tip.

                1 條回覆 最後回覆 回覆 引用 0
                • dinkumoilD
                  dinkumoil @Claudio Reniè
                  最後由 dinkumoil 編輯

                  @Claudio-Reniè , @ChelOis

                  There is, as there usually is, a possible workaround as long as you are willing to install a scripting plugin, in this case the NppExec plugin.

                  1. Install the NppExec plugin using PluginsAdmin.
                  2. After Notepad++ has restarted, paste the following code to a new document:
                  Option Explicit
                  
                  
                  'Constants declaration
                  Const SW_HIDE = 0
                  
                  
                  'Variables declaration
                  Dim colArgs, objFSO
                  Dim strSrcFilePath, strDstFilePath
                  
                  
                  'Create basic objects
                  Set colArgs = WScript.Arguments
                  Set objFSO  = CreateObject("Scripting.FileSystemObject")
                  
                  
                  'Not enough arguments => exit
                  If colArgs.Count < 2 Then WScript.Quit 1
                  
                  
                  'Retrieve source and destination file path from arguments
                  strSrcFilePath = colArgs(0)
                  strDstFilePath = colArgs(1)
                  
                  'Exit if
                  '  - source and destination file are equal
                  '  - source file doesn't exist
                  '  - destination file's folder doesn't exist
                  If StrComp(strSrcFilePath, strDstFilePath, vbTextCompare) = 0 Then WScript.Quit 0
                  If Not objFSO.FileExists(strSrcFilePath) Then WScript.Quit 2
                  If Not objFSO.FolderExists(objFSO.GetParentFolderName(strDstFilePath)) Then WScript.Quit 3
                  
                  
                  'Script doesn't run with admin rights => Restart elevated
                  If Not IsElevated Then
                    Call RestartElevated(SW_HIDE, Array(strSrcFilePath, strDstFilePath))
                  End If
                  
                  
                  'Destination file already exists => delete it
                  If objFSO.FileExists(strDstFilePath) Then
                    Call objFSO.DeleteFile(strDstFilePath)
                  End If
                  
                  'Move source file to destination
                  Call objFSO.MoveFile(strSrcFilePath, strDstFilePath)
                  
                  
                  
                  
                  '===============================================================================
                  ' Check if script runs with elevated user rights
                  '===============================================================================
                  
                  Function IsElevated()
                    Dim objWshShell, strKey
                  
                    Set objWshShell = CreateObject("WScript.Shell")
                  
                    On Error Resume Next
                    strKey = objWshShell.RegRead("HKEY_USERS\S-1-5-19\Environment\TEMP")
                  
                    IsElevated = (Err.Number = 0)
                  End Function
                  
                  
                  '===============================================================================
                  ' Restart script with elevated user rights
                  '===============================================================================
                  
                  Sub RestartElevated(ByVal intShowState, ByRef arrParams)
                    Dim objFSO, arrArguments(), intCnt
                  
                    Set objFSO = CreateObject("Scripting.FileSystemObject")
                  
                    ReDim arrArguments(UBound(arrParams) + 2)
                  
                    arrArguments(0) = "/nologo"
                    arrArguments(1) = WScript.ScriptFullName
                  
                    For intCnt = 2 To UBound(arrArguments)
                      arrArguments(intCnt) = arrParams(intCnt - 2)
                    Next
                  
                    Call RunElevated(WScript.FullName, objFSO.GetParentFolderName(WScript.ScriptFullName), intShowState, arrArguments)
                  
                    WScript.Quit 0
                  End Sub
                  
                  
                  Sub RunElevated(ByRef strCommand, ByRef strWorkFolder, ByVal intShowState, ByRef arrParams)
                    Dim objShell
                    Dim intCnt, strArguments
                  
                    Set objShell = CreateObject("Shell.Application")
                    strArguments = ""
                  
                    For intCnt = 0 To UBound(arrParams)
                      strArguments = strArguments & " " & Quote(arrParams(intCnt))
                    Next
                  
                    objShell.ShellExecute strCommand, strArguments, strWorkFolder, "runas", intShowState
                  End Sub
                  
                  
                  '===============================================================================
                  ' Surround a string with double quotes
                  '===============================================================================
                  
                  Function Quote(ByRef strString)
                    Quote = """" & strString & """"
                  End Function
                  
                  1. Save the document as SaveAsAdmin.vbs to a folder where you have write permissions.
                  2. In Windows Explorer, navigate to <Npp-directory>\plugins\NppExec and create a new directory SaveAsAdmin. Move the file saved in step 3. to this directory (Admin permissions required). If you prefer another location or name for this file, you have to change the script below accordingly.
                  3. In Notepad++, go to (menu) Plugins -> NppExec -> Execute... and paste the following code to the dialog popping up:
                  npp_console keep
                  
                  set local $(CurFilePath) = $(FULL_CURRENT_PATH)
                  
                  npe_console -- v+
                  cmd.exe /c "@echo %RANDOM%"
                  set local $(TempFilePath) = $(SYS.TEMP)\NppSAA_TempFile_$(OUTPUT1)_$(FILE_NAME)
                  npe_console -- v-
                  
                  npp_saveas "$(TempFilePath)"
                  npp_close
                  
                  cscript.exe /nologo "$(NPP_DIRECTORY)\plugins\NppExec\SaveAsAdmin\SaveAsAdmin.vbs" "$(TempFilePath)" "$(CurFilePath)"
                  
                  sleep 200
                  npp_open "$(CurFilePath)"
                  
                  1. In the combobox at the lower left enter SaveAsAdmin and click the Save button.
                  2. Go to (menu) Plugins -> NppExec -> Advanced Options.... Use the UI at the left hand side of the dialog to create a menu entry in Npp’s Macro menu for the script you saved in step 6.
                  3. Click OK button and restart Notepad++.
                  4. Go to (menu) Settings -> Shortcut Mapper... -> (register) Plugin commands and define a keyboard shortcut for the menu entry you created in step 7.

                  When you want to save a file that needs admin permissions to be written, press the configured keyboard shortcut and confirm the UAC dialog popping up.

                  Small flaw: The file has to be closed and reopened with Notepad++, thus its tab will be the rightmost one in tabbar.

                  Çağatay KAYA 0Ç Claudio RenièC 2 條回覆 最後回覆 回覆 引用 4
                  • Çağatay KAYA 0Ç
                    Çağatay KAYA 0 @dinkumoil
                    最後由 編輯

                    @dinkumoil

                    Thank you so much, it works like a charm.

                    1 條回覆 最後回覆 回覆 引用 0
                    • Claudio RenièC
                      Claudio Reniè @dinkumoil
                      最後由 dinkumoil 編輯

                      @dinkumoil

                      WOW… Apparently it seems complicated to me but I’ll try … thanks again and let you know

                      [EDIT]
                      Lengthy quote including source code removed
                      [/EDIT]

                      dinkumoilD 1 條回覆 最後回覆 回覆 引用 0
                      • dinkumoilD
                        dinkumoil @Claudio Reniè
                        最後由 dinkumoil 編輯

                        @Claudio-Reniè

                        Meanwhile another user at GitHub figured out that plugin version 1.0.172 still works, thus you can also use this old version (have a look at Releases section of the plugin repo). AFAIK it lacks support for elevating Save as... user interaction.

                        1 條回覆 最後回覆 回覆 引用 5
                        • Claudio RenièC
                          Claudio Reniè
                          最後由 Claudio Reniè 編輯

                          I wanted to point out that here the new version compatible with notepad ++ 7.9.3 has been released (without the reported error).

                          RESOLVED

                          1 條回覆 最後回覆 回覆 引用 3
                          • 第一個貼文
                            最後的貼文
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors