Fix installer fails to update NppShell.dll

Fix #13496
This commit is contained in:
Don Ho 2023-04-11 17:59:38 +02:00
parent cca3eccea1
commit 6d917af8ba
3 changed files with 21 additions and 18 deletions

View File

@ -268,6 +268,11 @@ ${MementoSection} "Context Menu Entry" explorerContextMenu
SetOverwrite try
SetOutPath "$INSTDIR\contextMenu\"
IfFileExists $INSTDIR\contextmenu\NppShell.dll 0 +2
ExecWait 'rundll32.exe "$INSTDIR\contextmenu\NppShell.dll",CleanupDll'
!ifdef ARCH64
File /oname=$INSTDIR\contextMenu\NppShell.msix "..\bin64\NppShell.msix"
File /oname=$INSTDIR\contextMenu\NppShell.dll "..\bin64\NppShell.x64.dll"
@ -287,7 +292,7 @@ ${MementoSection} "Context Menu Entry" explorerContextMenu
!endif
Exec 'regsvr32 /s "$INSTDIR\contextMenu\NppShell.dll"'
ExecWait 'regsvr32 /s "$INSTDIR\contextMenu\NppShell.dll"'
${MementoSectionEnd}

View File

@ -339,31 +339,31 @@ FunctionEnd
Function removeOldContextMenu
; Context Menu Management : removing old version of Context Menu module
IfFileExists "$INSTDIR\nppcm.dll" 0 +3
Exec 'regsvr32 /u /s "$INSTDIR\nppcm.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\nppcm.dll"'
Delete "$INSTDIR\nppcm.dll"
IfFileExists "$INSTDIR\NppShell.dll" 0 +3
Exec 'regsvr32 /u /s "$INSTDIR\NppShell.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell.dll"'
Delete "$INSTDIR\NppShell.dll"
IfFileExists "$INSTDIR\NppShell_01.dll" 0 +3
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_01.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_01.dll"'
Delete "$INSTDIR\NppShell_01.dll"
IfFileExists "$INSTDIR\NppShell_02.dll" 0 +3
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_02.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_02.dll"'
Delete "$INSTDIR\NppShell_02.dll"
IfFileExists "$INSTDIR\NppShell_03.dll" 0 +3
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_03.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_03.dll"'
Delete "$INSTDIR\NppShell_03.dll"
IfFileExists "$INSTDIR\NppShell_04.dll" 0 +3
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_04.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_04.dll"'
Delete "$INSTDIR\NppShell_04.dll"
IfFileExists "$INSTDIR\NppShell_05.dll" 0 +3
Exec 'regsvr32 /u /s "$INSTDIR\NppShell_05.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_05.dll"'
Delete "$INSTDIR\NppShell_05.dll"
FunctionEnd

View File

@ -55,12 +55,12 @@ FunctionEnd
Section un.explorerContextMenu
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"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_01.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_02.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_03.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_04.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_05.dll"'
ExecWait 'regsvr32 /u /s "$INSTDIR\NppShell_06.dll"'
Delete "$INSTDIR\NppShell_01.dll"
Delete "$INSTDIR\NppShell_02.dll"
Delete "$INSTDIR\NppShell_03.dll"
@ -68,9 +68,7 @@ Section un.explorerContextMenu
Delete "$INSTDIR\NppShell_05.dll"
Delete "$INSTDIR\NppShell_06.dll"
Exec 'regsvr32 /u /s "$INSTDIR\contextmenu\NppShell.dll"'
;Delete "$INSTDIR\contextmenu\NppShell.dll"
;Delete "$INSTDIR\contextmenu\NppShell.msix"
ExecWait 'regsvr32 /u /s "$INSTDIR\contextmenu\NppShell.dll"'
SectionEnd
Section un.UnregisterFileExt
@ -294,7 +292,7 @@ Section Uninstall
; In order to not delete context menu binary before we unregistered it,
; we delete them at the end, using the CleanupDll function, since it can be locked by explorer.
Exec 'rundll32.exe "$INSTDIR\contextmenu\NppShell.dll",CleanupDll'
ExecWait 'rundll32.exe "$INSTDIR\contextmenu\NppShell.dll",CleanupDll'
Delete "$INSTDIR\contextmenu\NppShell.msix"