From e28db057544acdef37741b465d883c7ccae0862e Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 30 Mar 2023 23:21:48 +0200 Subject: [PATCH] Fix "Edit with Notepad++" context menu needs restarting OS issue Fix context menu disappears issue while update. It works with https://github.com/notepad-plus-plus/nppShell/pull/14 to fix https://github.com/notepad-plus-plus/nppShell/issues/13 It fixes also the added dependency of the service "Application Information". Fix #13446, fix #13457 --- PowerEditor/installer/nppSetup.nsi | 40 +++++-------------- .../installer/nsisInclude/uninstall.nsh | 6 --- PowerEditor/src/notepad++.exe.manifest | 5 --- 3 files changed, 11 insertions(+), 40 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index dddc1645b..f06de4d7a 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -262,50 +262,32 @@ FunctionEnd !include "nsisInclude\themes.nsh" -!include "StrFunc.nsh" -${Using:StrFunc} StrStr - -Var muiVerbStr -Var nppSubStr ${MementoSection} "Context Menu Entry" explorerContextMenu SetOverwrite try - SetOutPath "$INSTDIR\contextmenu\" - + SetOutPath "$INSTDIR\contextMenu\" + !ifdef ARCH64 - File /oname=$INSTDIR\contextmenu\NppShell.msix "..\bin64\NppShell.msix" - File /oname=$INSTDIR\contextmenu\NppShell.dll "..\bin64\NppShell.x64.dll" + File /oname=$INSTDIR\contextMenu\NppShell.msix "..\bin64\NppShell.msix" + File /oname=$INSTDIR\contextMenu\NppShell.dll "..\bin64\NppShell.x64.dll" !else ifdef ARCHARM64 - File /oname=$INSTDIR\contextmenu\NppShell.msix "..\binarm64\NppShell.msix" - File /oname=$INSTDIR\contextmenu\NppShell.dll "..\binarm64\NppShell.arm64.dll" + File /oname=$INSTDIR\contextMenu\NppShell.msix "..\binarm64\NppShell.msix" + File /oname=$INSTDIR\contextMenu\NppShell.dll "..\binarm64\NppShell.arm64.dll" !else ; We need to test which arch we are running on, since 32bit exe can be run on both 32bit and 64bit Windows. ${If} ${RunningX64} ; We are running on 64bit Windows, so we need the msix as well, since it might be Windows 11. - File /oname=$INSTDIR\contextmenu\NppShell.msix "..\bin64\NppShell.msix" - File /oname=$INSTDIR\contextmenu\NppShell.dll "..\bin64\NppShell.x64.dll" + File /oname=$INSTDIR\contextMenu\NppShell.msix "..\bin64\NppShell.msix" + File /oname=$INSTDIR\contextMenu\NppShell.dll "..\bin64\NppShell.x64.dll" ${Else} ; We are running on 32bit Windows, so no need for the msix file, since there is no way this could even be upgraded to Windows 11. - File /oname=$INSTDIR\contextmenu\NppShell.dll "..\bin\NppShell.x86.dll" + File /oname=$INSTDIR\contextMenu\NppShell.dll "..\bin\NppShell.x86.dll" ${EndIf} !endif - Exec 'regsvr32 /s "$INSTDIR\contextmenu\NppShell.dll"' - - ; Make sure old NppShell dll's are unregistered and removed - Exec 'regsvr32 /u /s "$INSTDIR\NppShell_01.dll"' - Exec 'regsvr32 /u /s "$INSTDIR\NppShell_02.dll"' - Exec 'regsvr32 /u /s "$INSTDIR\NppShell_03.dll"' - Exec 'regsvr32 /u /s "$INSTDIR\NppShell_04.dll"' - Exec 'regsvr32 /u /s "$INSTDIR\NppShell_05.dll"' - Exec 'regsvr32 /u /s "$INSTDIR\NppShell_06.dll"' - Delete "$INSTDIR\NppShell_01.dll" - Delete "$INSTDIR\NppShell_02.dll" - Delete "$INSTDIR\NppShell_03.dll" - Delete "$INSTDIR\NppShell_04.dll" - Delete "$INSTDIR\NppShell_05.dll" - Delete "$INSTDIR\NppShell_06.dll" + + Exec 'regsvr32 /s "$INSTDIR\contextMenu\NppShell.dll"' ${MementoSectionEnd} diff --git a/PowerEditor/installer/nsisInclude/uninstall.nsh b/PowerEditor/installer/nsisInclude/uninstall.nsh index 366ae07ec..68fe2d2eb 100644 --- a/PowerEditor/installer/nsisInclude/uninstall.nsh +++ b/PowerEditor/installer/nsisInclude/uninstall.nsh @@ -54,12 +54,6 @@ Function un.onUninstSuccess FunctionEnd -!include "StrFunc.nsh" -${Using:StrFunc} UnStrStr - -Var muiVerbStrUn -Var nppSubStrUn - Section un.explorerContextMenu Exec 'regsvr32 /u /s "$INSTDIR\NppShell_01.dll"' Exec 'regsvr32 /u /s "$INSTDIR\NppShell_02.dll"' diff --git a/PowerEditor/src/notepad++.exe.manifest b/PowerEditor/src/notepad++.exe.manifest index 47a78fbc5..b78fd9175 100644 --- a/PowerEditor/src/notepad++.exe.manifest +++ b/PowerEditor/src/notepad++.exe.manifest @@ -7,11 +7,6 @@ name="Notepad++" type="win32" /> - Notepad++