patch 9.1.0191: Installer does not remove all files

Problem:  Installer does not remove all files
Solution: Update installer and delete all files on uninstall
          update Sodium library dependency, update Readme
          (RestorerZ)

closes: #14214

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
RestorerZ
2024-03-20 20:15:51 +01:00
committed by Christian Brabandt
parent 8950bf7f8b
commit 2680a074d4
5 changed files with 78 additions and 25 deletions

View File

@ -408,7 +408,7 @@ jobs:
# winpty # winpty
WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip WINPTY_URL: https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip
# libsodium # libsodium
SODIUM_VER: '1.0.18' SODIUM_VER: '1.0.19'
SODIUM_MSVC_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-msvc.zip SODIUM_MSVC_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-msvc.zip
SODIUM_MSVC_VER: v143 SODIUM_MSVC_VER: v143
SODIUM_MINGW_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-mingw.tar.gz SODIUM_MINGW_URL: https://download.libsodium.org/libsodium/releases/libsodium-%SODIUM_VER%-stable-mingw.tar.gz

View File

@ -29,18 +29,26 @@ To build the installable .exe:
4. Get a "diff.exe" program. If you skip this the built-in diff will always 4. Get a "diff.exe" program. If you skip this the built-in diff will always
be used (which is fine for most users). If you do have your own be used (which is fine for most users). If you do have your own
"diff.exe" put it in the "../.." directory (above the "vim90" directory, "diff.exe" put it in the "../.." directory (above the "vim91" directory,
it's the same for all Vim versions). it's the same for all Vim versions).
You can find one in previous Vim versions or in this archive: You can find one in previous Vim versions or in this archive:
http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz
5 Also put winpty32.dll and winpty-agent.exe in "../.." (above the "vim90" 5. Also put "winpty32.dll" and "winpty-agent.exe" in "../.." (above the "vim91"
directory). This is required for the terminal window. directory). This is required for the terminal window.
6. Do "make uganda.nsis.txt" in runtime/doc. This requires sed, you may have 6. To use stronger encryption, add the Sodium library. You can get it here:
https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19-msvc.zip
Unpack the archive. Put the "libsodium.dll" from
path/to/libsodium/Win32/Release/v143/dynamic for the 32bit version or
path/to/libsodium/X64/Release/v143/dynamic for the 64bit version in the
"../.." directory (above the "vim91" directory, where "diff.exe" and
"winpty32.dll").
7. Do "make uganda.nsis.txt" in runtime/doc. This requires sed, you may have
to do this on Unix. Make sure the file is in DOS file format! to do this on Unix. Make sure the file is in DOS file format!
7. Get gettext and iconv DLLs from the following site: 8. Get gettext and iconv DLLs from the following site:
https://github.com/mlocati/gettext-iconv-windows/releases https://github.com/mlocati/gettext-iconv-windows/releases
Both 64- and 32-bit versions are needed. Both 64- and 32-bit versions are needed.
Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract

View File

@ -1,6 +1,6 @@
# NSIS file to create a self-installing exe for Vim. # NSIS file to create a self-installing exe for Vim.
# It requires NSIS version 3.0 or later. # It requires NSIS version 3.0 or later.
# Last Change: 2014 Nov 5 # Last Change: 2024 Mar 17
Unicode true Unicode true
@ -58,6 +58,37 @@ Unicode true
!include "Sections.nsh" !include "Sections.nsh"
!include "x64.nsh" !include "x64.nsh"
# See https://nsis.sourceforge.io/LogicLib
;FileExists is already part of LogicLib, but returns true for directories
;as well as files
!macro _FileExists2 _a _b _t _f
!insertmacro _LOGICLIB_TEMP
StrCpy $_LOGICLIB_TEMP "0"
;if path is not blank, continue to next check
StrCmp `${_b}` `` +4 0
;if path exists, continue to next check (IfFileExists returns true if this
;is a directory)
IfFileExists `${_b}` `0` +3
;if path is not a directory, continue to confirm exists
IfFileExists `${_b}\*.*` +2 0
StrCpy $_LOGICLIB_TEMP "1" ;file exists
;now we have a definitive value - the file exists or it does not
StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
!macroend
!undef FileExists
!define FileExists `"" FileExists2`
!macro _DirExists _a _b _t _f
!insertmacro _LOGICLIB_TEMP
StrCpy $_LOGICLIB_TEMP "0"
;if path is not blank, continue to next check
StrCmp `${_b}` `` +3 0
;if directory exists, continue to confirm exists
IfFileExists `${_b}\*.*` 0 +2
StrCpy $_LOGICLIB_TEMP "1"
StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
!macroend
!define DirExists `"" DirExists`
!define PRODUCT "Vim ${VER_MAJOR}.${VER_MINOR}" !define PRODUCT "Vim ${VER_MAJOR}.${VER_MINOR}"
!define UNINST_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall" !define UNINST_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall"
!define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}" !define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}"
@ -365,9 +396,6 @@ Section "$(str_section_exe)" id_section_exe
File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe
!if /FileExists "${VIMSRC}\vim${BIT}.dll" !if /FileExists "${VIMSRC}\vim${BIT}.dll"
File ${VIMSRC}\vim${BIT}.dll File ${VIMSRC}\vim${BIT}.dll
!endif
!if /FileExists "${VIMRT}\libsodium.dll"
File ${VIMRT}\libsodium.dll
!endif !endif
File /oname=install.exe ${VIMSRC}\installw32.exe File /oname=install.exe ${VIMSRC}\installw32.exe
File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe
@ -379,9 +407,18 @@ Section "$(str_section_exe)" id_section_exe
File ..\uninstall.txt File ..\uninstall.txt
File ${VIMRT}\*.vim File ${VIMRT}\*.vim
!if /FileExists "${VIMTOOLS}\diff.exe"
File ${VIMTOOLS}\diff.exe File ${VIMTOOLS}\diff.exe
!endif
!if /FileExists "${VIMTOOLS}\winpty${BIT}.dll"
File ${VIMTOOLS}\winpty${BIT}.dll File ${VIMTOOLS}\winpty${BIT}.dll
!endif
!if /FileExists "${VIMTOOLS}\winpty-agent.exe"
File ${VIMTOOLS}\winpty-agent.exe File ${VIMTOOLS}\winpty-agent.exe
!endif
!if /FileExists "${VIMTOOLS}\libsodium.dll"
File ${VIMTOOLS}\libsodium.dll
!endif
SetOutPath $0\colors SetOutPath $0\colors
File /r ${VIMRT}\colors\*.* File /r ${VIMRT}\colors\*.*
@ -390,20 +427,22 @@ Section "$(str_section_exe)" id_section_exe
File ${VIMRT}\compiler\*.* File ${VIMRT}\compiler\*.*
SetOutPath $0\doc SetOutPath $0\doc
File ${VIMRT}\doc\*.txt File /x uganda.nsis.txt ${VIMRT}\doc\*.txt
File ${VIMRT}\doc\tags File ${VIMRT}\doc\tags
SetOutPath $0\ftplugin SetOutPath $0\ftplugin
File ${VIMRT}\ftplugin\*.* File ${VIMRT}\ftplugin\*.*
SetOutPath $0\indent SetOutPath $0\indent
File ${VIMRT}\indent\*.* File ${VIMRT}\indent\README.txt
File ${VIMRT}\indent\*.vim
SetOutPath $0\keymap SetOutPath $0\keymap
File ${VIMRT}\keymap\*.* File ${VIMRT}\keymap\README.txt
File ${VIMRT}\keymap\*.vim
SetOutPath $0\macros SetOutPath $0\macros
File /r ${VIMRT}\macros\*.* File /r /x *.info ${VIMRT}\macros\*.*
SetOutPath $0\pack SetOutPath $0\pack
File /r ${VIMRT}\pack\*.* File /r ${VIMRT}\pack\*.*
@ -421,7 +460,7 @@ Section "$(str_section_exe)" id_section_exe
File ${VIMSRC}\vim.ico File ${VIMSRC}\vim.ico
SetOutPath $0\syntax SetOutPath $0\syntax
File /r /x testdir /x generator ${VIMRT}\syntax\*.* File /r /x testdir /x generator /x Makefile ${VIMRT}\syntax\*.*
SetOutPath $0\spell SetOutPath $0\spell
File ${VIMRT}\spell\*.txt File ${VIMRT}\spell\*.txt
@ -433,7 +472,7 @@ Section "$(str_section_exe)" id_section_exe
File ${VIMRT}\tools\*.* File ${VIMRT}\tools\*.*
SetOutPath $0\tutor SetOutPath $0\tutor
File ${VIMRT}\tutor\*.* File /x Makefile /x *.info ${VIMRT}\tutor\*.*
SectionEnd SectionEnd
########################################################## ##########################################################
@ -564,10 +603,7 @@ Section "$(str_section_nls)" id_section_nls
SectionIn 1 3 SectionIn 1 3
SetOutPath $0\lang SetOutPath $0\lang
File /r ${VIMRT}\lang\*.* File /r /x Makefile ${VIMRT}\lang\*.*
SetOutPath $0\keymap
File ${VIMRT}\keymap\README.txt
File ${VIMRT}\keymap\*.vim
SetOutPath $0 SetOutPath $0
!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
"${GETTEXT}\gettext${BIT}\libintl-8.dll" \ "${GETTEXT}\gettext${BIT}\libintl-8.dll" \
@ -947,7 +983,7 @@ Section "un.$(str_unsection_register)" id_unsection_register
SectionIn RO SectionIn RO
# Apparently $INSTDIR is set to the directory where the uninstaller is # Apparently $INSTDIR is set to the directory where the uninstaller is
# created. Thus the "vim61" directory is included in it. # created. Thus the "vim91" directory is included in it.
StrCpy $0 "$INSTDIR" StrCpy $0 "$INSTDIR"
# delete the context menu entry and batch files # delete the context menu entry and batch files
@ -1044,6 +1080,7 @@ Section "un.$(str_unsection_exe)" id_unsection_exe
RMDir /r $0\tutor RMDir /r $0\tutor
RMDir /r $0\lang RMDir /r $0\lang
RMDir /r $0\keymap RMDir /r $0\keymap
RMDir /r $0\bitmaps
Delete $0\*.exe Delete $0\*.exe
Delete $0\*.bat Delete $0\*.bat
Delete $0\*.vim Delete $0\*.vim
@ -1053,14 +1090,17 @@ Section "un.$(str_unsection_exe)" id_unsection_exe
MessageBox MB_OK|MB_ICONEXCLAMATION $(str_msg_rm_exe_fail) /SD IDOK MessageBox MB_OK|MB_ICONEXCLAMATION $(str_msg_rm_exe_fail) /SD IDOK
${EndIf} ${EndIf}
# No error message if the "vim62" directory can't be removed, the # No error message if the "vim91" directory can't be removed, the
# gvimext.dll may still be there. # gvimext.dll may still be there.
RMDir $0 RMDir $0
SectionEnd SectionEnd
# Remove "vimfiles" directory under the specified directory. # Remove "vimfiles" directory under the specified directory.
!macro RemoveVimfiles dir !macro RemoveVimfiles dir
${If} ${FileExists} ${dir}\vimfiles ${If} ${FileExists} ${dir}\_viminfo
Delete ${dir}\_viminfo
${EndIf}
${If} ${DirExists} ${dir}\vimfiles
RMDir ${dir}\vimfiles\colors RMDir ${dir}\vimfiles\colors
RMDir ${dir}\vimfiles\compiler RMDir ${dir}\vimfiles\compiler
RMDir ${dir}\vimfiles\doc RMDir ${dir}\vimfiles\doc
@ -1070,6 +1110,9 @@ SectionEnd
RMDir ${dir}\vimfiles\keymap RMDir ${dir}\vimfiles\keymap
RMDir ${dir}\vimfiles\plugin RMDir ${dir}\vimfiles\plugin
RMDir ${dir}\vimfiles\syntax RMDir ${dir}\vimfiles\syntax
${If} ${FileExists} ${dir}\vimfiles\.netrwhist*
Delete ${dir}\vimfiles\.netrwhist*
${EndIf}
RMDir ${dir}\vimfiles RMDir ${dir}\vimfiles
${EndIf} ${EndIf}
!macroend !macroend

View File

@ -374,9 +374,9 @@ DYNAMIC_SODIUM = yes
!if "$(SODIUM)" != "no" !if "$(SODIUM)" != "no"
! if "$(CPU)" == "AMD64" ! if "$(CPU)" == "AMD64"
SOD_LIB = $(SODIUM)\x64\Release\v140\dynamic SOD_LIB = $(SODIUM)\x64\Release\v143\dynamic
! elseif "$(CPU)" == "i386" ! elseif "$(CPU)" == "i386"
SOD_LIB = $(SODIUM)\Win32\Release\v140\dynamic SOD_LIB = $(SODIUM)\Win32\Release\v143\dynamic
! else ! else
SODIUM = no SODIUM = no
! endif ! endif

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
191,
/**/ /**/
190, 190,
/**/ /**/