From 9c15bdc236d5f62f4f418f26bee189638a380f86 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 20 Mar 2023 00:37:44 +0100 Subject: [PATCH] Fix unregister modern context menu syntax error and remove concerning binaries during uninstallation --- PowerEditor/installer/nppSetup.nsi | 2 +- PowerEditor/installer/nsisInclude/uninstall.nsh | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index a932f232e..9e4a82a1a 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -289,7 +289,7 @@ ${MementoSection} "Context Menu Entry" explorerContextMenu File /oname=$INSTDIR\NppModernShell.msix "..\bin64\NppModernShell.msix" File /oname=$INSTDIR\NppModernShell.dll "..\bin64\NppModernShell.dll" !endif - Exec 'rundll32.exe"$INSTDIR\NppModernShell.dll,RegisterSparsePackage"' + Exec 'rundll32.exe "$INSTDIR\NppModernShell.dll",RegisterSparsePackage' ; Make sure old NppShell dll's are unregistered and removed Exec 'regsvr32 /u /s "$INSTDIR\NppShell_01.dll"' diff --git a/PowerEditor/installer/nsisInclude/uninstall.nsh b/PowerEditor/installer/nsisInclude/uninstall.nsh index 3b34a0f46..1e13db5c3 100644 --- a/PowerEditor/installer/nsisInclude/uninstall.nsh +++ b/PowerEditor/installer/nsisInclude/uninstall.nsh @@ -41,11 +41,13 @@ Function un.onUninstSuccess RMDir "$INSTDIR\plugins\" RMDir "$INSTDIR\updater\" RMDir "$INSTDIR\autoCompletion\" + RMDir "$INSTDIR\functionList\" + RMDir "$INSTDIR\themes\" RMDir "$INSTDIR\" RMDir "$APPDATA\${APPNAME}\plugins\" - RMDir "$installPath\userDefineLangs\" RMDir "$installPath\themes\" ; if files are kept because of $keepUserData, this will not be deleted + RMDir "$installPath\userDefineLangs\" RMDir "$installPath\" FunctionEnd @@ -70,7 +72,9 @@ Section un.explorerContextMenu Delete "$INSTDIR\NppShell_05.dll" Delete "$INSTDIR\NppShell_06.dll" - Exec 'rundll32.exe"$INSTDIR\NppModernShell.dll,UnregisterSparsePackage"' + Exec 'rundll32.exe "$INSTDIR\NppModernShell.dll",UnregisterSparsePackage' + ;Delete "$INSTDIR\NppModernShell.dll" + ;Delete "$INSTDIR\NppModernShell.msix" ReadRegStr $muiVerbStrUn HKLM "SOFTWARE\Classes\*\shell\pintohome" MUIVerb ${UnStrStr} $nppSubStrUn $muiVerbStrUn "Notepad++" @@ -301,6 +305,12 @@ Section Uninstall SetShellVarContext all ; make context for all user ${endIf} + ; In order to not delete context menu binary before we unregistered it, + ; we delete them at the end + Delete "$INSTDIR\NppModernShell.dll" + Delete "$INSTDIR\NppModernShell.msix" + + ; Remove remaining directories RMDir /r "$INSTDIR\plugins\disabled\" RMDir "$INSTDIR\plugins\APIs\"