| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | # NSIS file to create a self-installing exe for Vim.
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # It requires NSIS version 3.0 or later.
 | 
					
						
							| 
									
										
										
										
											2014-11-05 18:18:17 +01:00
										 |  |  | # Last Change:	2014 Nov 5
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | Unicode true
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | # WARNING: if you make changes to this script, look out for $0 to be valid,
 | 
					
						
							|  |  |  | # because uninstall deletes most files in $0.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-04 22:35:01 +02:00
										 |  |  | # Location of gvim_ole.exe, vimw32.exe, GvimExt/*, etc.
 | 
					
						
							| 
									
										
										
										
											2016-01-16 18:05:50 +01:00
										 |  |  | !ifndef VIMSRC
 | 
					
						
							|  |  |  |   !define VIMSRC "..\src"
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Location of runtime files
 | 
					
						
							| 
									
										
										
										
											2016-01-16 18:05:50 +01:00
										 |  |  | !ifndef VIMRT
 | 
					
						
							|  |  |  |   !define VIMRT ".."
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Location of extra tools: diff.exe
 | 
					
						
							| 
									
										
										
										
											2016-01-16 18:05:50 +01:00
										 |  |  | !ifndef VIMTOOLS
 | 
					
						
							|  |  |  |   !define VIMTOOLS ..\..
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-14 19:05:44 +02:00
										 |  |  | # Location of gettext.
 | 
					
						
							|  |  |  | # It must contain two directories: gettext32 and gettext64.
 | 
					
						
							|  |  |  | # See README.txt for detail.
 | 
					
						
							|  |  |  | !ifndef GETTEXT
 | 
					
						
							|  |  |  |   !define GETTEXT ${VIMRT}
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | # Comment the next line if you don't have UPX.
 | 
					
						
							| 
									
										
										
										
											2017-10-14 19:05:44 +02:00
										 |  |  | # Get it at https://upx.github.io/
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | !define HAVE_UPX
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # Comment the next line if you do not want to add Native Language Support
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | !define HAVE_NLS
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # Uncomment the next line if you want to include VisVim extension:
 | 
					
						
							|  |  |  | #!define HAVE_VIS_VIM
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-02-12 21:03:32 +01:00
										 |  |  | # Comment the following line to create an English-only installer:
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !define HAVE_MULTI_LANG
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Uncomment the next line if you want to create a 64-bit installer.
 | 
					
						
							|  |  |  | #!define WIN64
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-02 15:44:32 +01:00
										 |  |  | !include gvim_version.nsh	# for version number
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-26 20:49:42 +02:00
										 |  |  | # Definition of Patch for Vim
 | 
					
						
							|  |  |  | !ifndef PATCHLEVEL
 | 
					
						
							|  |  |  |   !define PATCHLEVEL 0
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | # ----------- No configurable settings below this line -----------
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !include "Library.nsh"		# For DLL install
 | 
					
						
							|  |  |  | !ifdef HAVE_VIS_VIM
 | 
					
						
							|  |  |  |   !include "UpgradeDLL.nsh"	# for VisVim.dll
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | !include "LogicLib.nsh"
 | 
					
						
							|  |  |  | !include "MUI2.nsh"
 | 
					
						
							|  |  |  | !include "nsDialogs.nsh"
 | 
					
						
							|  |  |  | !include "Sections.nsh"
 | 
					
						
							|  |  |  | !include "x64.nsh"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !define PRODUCT		"Vim ${VER_MAJOR}.${VER_MINOR}"
 | 
					
						
							|  |  |  | !define UNINST_REG_KEY	"Software\Microsoft\Windows\CurrentVersion\Uninstall"
 | 
					
						
							|  |  |  | !define UNINST_REG_KEY_VIM  "${UNINST_REG_KEY}\${PRODUCT}"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !ifdef WIN64
 | 
					
						
							|  |  |  | Name "${PRODUCT} (x64)"
 | 
					
						
							|  |  |  | !else
 | 
					
						
							|  |  |  | Name "${PRODUCT}"
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | OutFile gvim${VER_MAJOR}${VER_MINOR}.exe
 | 
					
						
							|  |  |  | CRCCheck force
 | 
					
						
							| 
									
										
										
										
											2016-01-16 18:05:50 +01:00
										 |  |  | SetCompressor /SOLID lzma
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | SetCompressorDictSize 64
 | 
					
						
							|  |  |  | ManifestDPIAware true
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | SetDatablockOptimize on
 | 
					
						
							| 
									
										
										
										
											2010-05-24 21:34:22 +02:00
										 |  |  | RequestExecutionLevel highest
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | !ifdef HAVE_UPX
 | 
					
						
							|  |  |  |   !packhdr temp.dat "upx --best --compress-icons=1 temp.dat"
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !ifdef WIN64
 | 
					
						
							|  |  |  | !define BIT	64
 | 
					
						
							|  |  |  | !else
 | 
					
						
							|  |  |  | !define BIT	32
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							|  |  |  | # MUI2 settings
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !define MUI_ABORTWARNING
 | 
					
						
							|  |  |  | !define MUI_UNABORTWARNING
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !define MUI_ICON   "icons\vim_16c.ico"
 | 
					
						
							|  |  |  | !define MUI_UNICON "icons\vim_uninst_16c.ico"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Show all languages, despite user's codepage:
 | 
					
						
							|  |  |  | !define MUI_LANGDLL_ALLLANGUAGES
 | 
					
						
							|  |  |  | !define MUI_LANGDLL_REGISTRY_ROOT       "HKCU"
 | 
					
						
							|  |  |  | !define MUI_LANGDLL_REGISTRY_KEY        "Software\Vim"
 | 
					
						
							|  |  |  | !define MUI_LANGDLL_REGISTRY_VALUENAME  "Installer Language"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !define MUI_WELCOMEFINISHPAGE_BITMAP       "icons\welcome.bmp"
 | 
					
						
							|  |  |  | !define MUI_UNWELCOMEFINISHPAGE_BITMAP     "icons\uninstall.bmp"
 | 
					
						
							|  |  |  | !define MUI_HEADERIMAGE
 | 
					
						
							|  |  |  | !define MUI_HEADERIMAGE_BITMAP             "icons\header.bmp"
 | 
					
						
							|  |  |  | !define MUI_HEADERIMAGE_UNBITMAP           "icons\un_header.bmp"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !define MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH    "AspectFitHeight"
 | 
					
						
							|  |  |  | !define MUI_UNWELCOMEFINISHPAGE_BITMAP_STRETCH  "AspectFitHeight"
 | 
					
						
							|  |  |  | !define MUI_HEADERIMAGE_BITMAP_STRETCH          "AspectFitHeight"
 | 
					
						
							|  |  |  | !define MUI_HEADERIMAGE_UNBITMAP_STRETCH        "AspectFitHeight"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !define MUI_COMPONENTSPAGE_SMALLDESC
 | 
					
						
							|  |  |  | !define MUI_LICENSEPAGE_CHECKBOX
 | 
					
						
							| 
									
										
										
										
											2021-05-01 22:41:39 +02:00
										 |  |  | !define MUI_FINISHPAGE_RUN
 | 
					
						
							|  |  |  | !define MUI_FINISHPAGE_RUN_FUNCTION        LaunchApplication
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !define MUI_FINISHPAGE_RUN_TEXT            $(str_show_readme)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # This adds '\Vim' to the user choice automagically.  The actual value is
 | 
					
						
							|  |  |  | # obtained below with CheckOldVim.
 | 
					
						
							|  |  |  | !ifdef WIN64
 | 
					
						
							| 
									
										
										
										
											2021-07-24 21:19:42 +02:00
										 |  |  |   !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !else
 | 
					
						
							| 
									
										
										
										
											2021-07-24 21:19:42 +02:00
										 |  |  |   !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2021-07-24 21:19:42 +02:00
										 |  |  | InstallDir ${DEFAULT_INSTDIR}
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Types of installs we can perform:
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | InstType $(str_type_typical)
 | 
					
						
							|  |  |  | InstType $(str_type_minimal)
 | 
					
						
							|  |  |  | InstType $(str_type_full)
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | SilentInstall normal
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # General custom functions for MUI2:
 | 
					
						
							|  |  |  | #!define MUI_CUSTOMFUNCTION_ABORT   VimOnUserAbort
 | 
					
						
							|  |  |  | #!define MUI_CUSTOMFUNCTION_UNABORT un.VimOnUserAbort
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Installer pages
 | 
					
						
							|  |  |  | !insertmacro MUI_PAGE_WELCOME
 | 
					
						
							|  |  |  | !insertmacro MUI_PAGE_LICENSE "${VIMRT}\doc\uganda.nsis.txt"
 | 
					
						
							|  |  |  | !insertmacro MUI_PAGE_COMPONENTS
 | 
					
						
							|  |  |  | Page custom SetCustom ValidateCustom
 | 
					
						
							|  |  |  | #!define MUI_PAGE_CUSTOMFUNCTION_LEAVE VimFinalCheck
 | 
					
						
							|  |  |  | !insertmacro MUI_PAGE_DIRECTORY
 | 
					
						
							|  |  |  | !insertmacro MUI_PAGE_INSTFILES
 | 
					
						
							|  |  |  | !define MUI_FINISHPAGE_NOREBOOTSUPPORT
 | 
					
						
							|  |  |  | !insertmacro MUI_PAGE_FINISH
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Uninstaller pages:
 | 
					
						
							|  |  |  | !insertmacro MUI_UNPAGE_CONFIRM
 | 
					
						
							|  |  |  | #!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.VimCheckRunning
 | 
					
						
							|  |  |  | !insertmacro MUI_UNPAGE_COMPONENTS
 | 
					
						
							|  |  |  | !insertmacro MUI_UNPAGE_INSTFILES
 | 
					
						
							|  |  |  | !define MUI_FINISHPAGE_NOREBOOTSUPPORT
 | 
					
						
							|  |  |  | !insertmacro MUI_UNPAGE_FINISH
 | 
					
						
							| 
									
										
										
										
											2018-02-04 19:11:30 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # Languages Files
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !insertmacro MUI_RESERVEFILE_LANGDLL
 | 
					
						
							|  |  |  | !include "lang\english.nsi"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Include support for other languages:
 | 
					
						
							|  |  |  | !ifdef HAVE_MULTI_LANG
 | 
					
						
							|  |  |  |     !include "lang\danish.nsi"
 | 
					
						
							|  |  |  |     !include "lang\dutch.nsi"
 | 
					
						
							|  |  |  |     !include "lang\german.nsi"
 | 
					
						
							|  |  |  |     !include "lang\italian.nsi"
 | 
					
						
							|  |  |  |     !include "lang\japanese.nsi"
 | 
					
						
							| 
									
										
										
										
											2020-09-20 21:43:03 +02:00
										 |  |  |     !include "lang\russian.nsi"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  |     !include "lang\simpchinese.nsi"
 | 
					
						
							|  |  |  |     !include "lang\tradchinese.nsi"
 | 
					
						
							| 
									
										
										
										
											2020-01-18 16:10:40 +01:00
										 |  |  |     !include "lang\turkish.nsi"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-17 12:37:27 +02:00
										 |  |  | ##########################################################
 | 
					
						
							|  |  |  | # Version resources
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Vim"
 | 
					
						
							|  |  |  | VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Vim Developers"
 | 
					
						
							|  |  |  | VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim"
 | 
					
						
							|  |  |  | VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996"
 | 
					
						
							|  |  |  | VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Vi Improved - A Text Editor"
 | 
					
						
							| 
									
										
										
										
											2019-05-26 20:49:42 +02:00
										 |  |  | VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
 | 
					
						
							|  |  |  | VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # Global variables
 | 
					
						
							|  |  |  | Var vim_dialog
 | 
					
						
							|  |  |  | Var vim_nsd_compat
 | 
					
						
							|  |  |  | Var vim_nsd_keymap
 | 
					
						
							|  |  |  | Var vim_nsd_mouse
 | 
					
						
							|  |  |  | Var vim_compat_stat
 | 
					
						
							|  |  |  | Var vim_keymap_stat
 | 
					
						
							|  |  |  | Var vim_mouse_stat
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # Reserve files
 | 
					
						
							|  |  |  | ReserveFile ${VIMSRC}\installw32.exe
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | ##########################################################
 | 
					
						
							|  |  |  | # Functions
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # Get parent directory
 | 
					
						
							|  |  |  | # Share this function both on installer and uninstaller
 | 
					
						
							|  |  |  | !macro GetParent un
 | 
					
						
							|  |  |  | Function ${un}GetParent
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   Exch $0 ; old $0 is on top of stack
 | 
					
						
							|  |  |  |   Push $1
 | 
					
						
							|  |  |  |   Push $2
 | 
					
						
							|  |  |  |   StrCpy $1 -1
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  |   ${Do}
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |     StrCpy $2 $0 1 $1
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  |     ${If} $2 == ""
 | 
					
						
							|  |  |  |     ${OrIf} $2 == "\"
 | 
					
						
							|  |  |  |       ${ExitDo}
 | 
					
						
							|  |  |  |     ${EndIf}
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |     IntOp $1 $1 - 1
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  |   ${Loop}
 | 
					
						
							|  |  |  |   StrCpy $0 $0 $1
 | 
					
						
							|  |  |  |   Pop $2
 | 
					
						
							|  |  |  |   Pop $1
 | 
					
						
							|  |  |  |   Exch $0 ; put $0 on top of stack, restore $0 to original value
 | 
					
						
							|  |  |  | FunctionEnd
 | 
					
						
							|  |  |  | !macroend
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !insertmacro GetParent ""
 | 
					
						
							|  |  |  | !insertmacro GetParent "un."
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Check if Vim is already installed.
 | 
					
						
							|  |  |  | # return: Installed directory. If not found, it will be empty.
 | 
					
						
							|  |  |  | Function CheckOldVim
 | 
					
						
							|  |  |  |   Push $0
 | 
					
						
							|  |  |  |   Push $R0
 | 
					
						
							|  |  |  |   Push $R1
 | 
					
						
							|  |  |  |   Push $R2
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ${If} ${RunningX64}
 | 
					
						
							|  |  |  |     SetRegView 64
 | 
					
						
							|  |  |  |   ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ClearErrors
 | 
					
						
							|  |  |  |   StrCpy $0  ""   # Installed directory
 | 
					
						
							|  |  |  |   StrCpy $R0 0    # Sub-key index
 | 
					
						
							|  |  |  |   StrCpy $R1 ""   # Sub-key
 | 
					
						
							|  |  |  |   ${Do}
 | 
					
						
							|  |  |  |     # Eumerate the sub-key:
 | 
					
						
							|  |  |  |     EnumRegKey $R1 HKLM ${UNINST_REG_KEY} $R0
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Stop if no more sub-key:
 | 
					
						
							|  |  |  |     ${If} ${Errors}
 | 
					
						
							|  |  |  |     ${OrIf} $R1 == ""
 | 
					
						
							|  |  |  |       ${ExitDo}
 | 
					
						
							|  |  |  |     ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Move to the next sub-key:
 | 
					
						
							|  |  |  |     IntOp $R0 $R0 + 1
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Check if the key is Vim uninstall key or not:
 | 
					
						
							|  |  |  |     StrCpy $R2 $R1 4
 | 
					
						
							|  |  |  |     ${If} $R2 S!= "Vim "
 | 
					
						
							|  |  |  |       ${Continue}
 | 
					
						
							|  |  |  |     ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Verifies required sub-keys:
 | 
					
						
							|  |  |  |     ReadRegStr $R2 HKLM "${UNINST_REG_KEY}\$R1" "DisplayName"
 | 
					
						
							|  |  |  |     ${If} ${Errors}
 | 
					
						
							|  |  |  |     ${OrIf} $R2 == ""
 | 
					
						
							|  |  |  |       ${Continue}
 | 
					
						
							|  |  |  |     ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ReadRegStr $R2 HKLM "${UNINST_REG_KEY}\$R1" "UninstallString"
 | 
					
						
							|  |  |  |     ${If} ${Errors}
 | 
					
						
							|  |  |  |     ${OrIf} $R2 == ""
 | 
					
						
							|  |  |  |       ${Continue}
 | 
					
						
							|  |  |  |     ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Found
 | 
					
						
							|  |  |  |     Push $R2
 | 
					
						
							|  |  |  |     call GetParent
 | 
					
						
							|  |  |  |     call GetParent
 | 
					
						
							|  |  |  |     Pop $0   # Vim directory
 | 
					
						
							|  |  |  |     ${ExitDo}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ${Loop}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ${If} ${RunningX64}
 | 
					
						
							|  |  |  |     SetRegView lastused
 | 
					
						
							|  |  |  |   ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Pop $R2
 | 
					
						
							|  |  |  |   Pop $R1
 | 
					
						
							|  |  |  |   Pop $R0
 | 
					
						
							|  |  |  |   Exch $0  # put $0 on top of stack, restore $0 to original value
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | FunctionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-01 22:41:39 +02:00
										 |  |  | Function LaunchApplication
 | 
					
						
							|  |  |  |    SetOutPath $0
 | 
					
						
							| 
									
										
										
										
											2021-05-02 13:59:46 +02:00
										 |  |  |    ShellExecAsUser::ShellExecAsUser "" "$0\gvim.exe" '-R "$0\README.txt"'
 | 
					
						
							| 
									
										
										
										
											2021-05-01 22:41:39 +02:00
										 |  |  | FunctionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | Section "$(str_section_old_ver)" id_section_old_ver
 | 
					
						
							|  |  |  | 	SectionIn 1 2 3 RO
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# run the install program to check for already installed versions
 | 
					
						
							|  |  |  | 	SetOutPath $TEMP
 | 
					
						
							|  |  |  | 	File /oname=install.exe ${VIMSRC}\installw32.exe
 | 
					
						
							|  |  |  | 	DetailPrint "$(str_msg_uninstalling)"
 | 
					
						
							|  |  |  | 	${Do}
 | 
					
						
							|  |  |  | 	  nsExec::Exec "$TEMP\install.exe -uninstall-check"
 | 
					
						
							|  |  |  | 	  Pop $3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	  call CheckOldVim
 | 
					
						
							|  |  |  | 	  Pop $3
 | 
					
						
							|  |  |  | 	  ${If} $3 == ""
 | 
					
						
							|  |  |  | 	    ${ExitDo}
 | 
					
						
							|  |  |  | 	  ${Else}
 | 
					
						
							|  |  |  | 	    # It seems that the old version is still remaining.
 | 
					
						
							|  |  |  | 	    # TODO: Should we show a warning and run the uninstaller again?
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	    ${ExitDo}	# Just ignore for now.
 | 
					
						
							|  |  |  | 	  ${EndIf}
 | 
					
						
							|  |  |  | 	${Loop}
 | 
					
						
							|  |  |  | 	Delete $TEMP\install.exe
 | 
					
						
							|  |  |  | 	Delete $TEMP\vimini.ini   # install.exe creates this, but we don't need it.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# We may have been put to the background when uninstall did something.
 | 
					
						
							|  |  |  | 	BringToFront
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							|  |  |  | Section "$(str_section_exe)" id_section_exe
 | 
					
						
							| 
									
										
										
										
											2017-09-17 21:00:03 +02:00
										 |  |  | 	SectionIn 1 2 3 RO
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# we need also this here if the user changes the instdir
 | 
					
						
							|  |  |  | 	StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0
 | 
					
						
							|  |  |  | 	File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe
 | 
					
						
							| 
									
										
										
										
											2019-04-28 19:46:49 +02:00
										 |  |  | !if /FileExists "${VIMSRC}\vim${BIT}.dll"
 | 
					
						
							|  |  |  | 	File ${VIMSRC}\vim${BIT}.dll
 | 
					
						
							| 
									
										
										
										
											2022-02-13 13:11:32 +00:00
										 |  |  | !endif
 | 
					
						
							|  |  |  | !if /FileExists "${VIMRT}\libsodium.dll"
 | 
					
						
							|  |  |  | 	File ${VIMRT}\libsodium.dll
 | 
					
						
							| 
									
										
										
										
											2019-04-28 19:46:49 +02:00
										 |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	File /oname=install.exe ${VIMSRC}\installw32.exe
 | 
					
						
							| 
									
										
										
										
											2019-09-27 13:08:36 +02:00
										 |  |  | 	File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	File ${VIMSRC}\vimrun.exe
 | 
					
						
							| 
									
										
										
										
											2016-08-28 18:47:14 +02:00
										 |  |  | 	File /oname=tee.exe ${VIMSRC}\teew32.exe
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	File /oname=xxd.exe ${VIMSRC}\xxdw32.exe
 | 
					
						
							| 
									
										
										
										
											2018-12-21 17:59:33 +01:00
										 |  |  | 	File ..\vimtutor.bat
 | 
					
						
							|  |  |  | 	File ..\README.txt
 | 
					
						
							| 
									
										
										
										
											2019-09-27 13:08:36 +02:00
										 |  |  | 	File ..\uninstall.txt
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	File ${VIMRT}\*.vim
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-19 13:29:19 +02:00
										 |  |  | 	File ${VIMTOOLS}\diff.exe
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	File ${VIMTOOLS}\winpty${BIT}.dll
 | 
					
						
							| 
									
										
										
										
											2017-08-19 13:29:19 +02:00
										 |  |  | 	File ${VIMTOOLS}\winpty-agent.exe
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SetOutPath $0\colors
 | 
					
						
							| 
									
										
										
										
											2022-08-24 18:08:00 +01:00
										 |  |  | 	File /r ${VIMRT}\colors\*.*
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0\compiler
 | 
					
						
							|  |  |  | 	File ${VIMRT}\compiler\*.*
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0\doc
 | 
					
						
							|  |  |  | 	File ${VIMRT}\doc\*.txt
 | 
					
						
							|  |  |  | 	File ${VIMRT}\doc\tags
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0\ftplugin
 | 
					
						
							|  |  |  | 	File ${VIMRT}\ftplugin\*.*
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0\indent
 | 
					
						
							|  |  |  | 	File ${VIMRT}\indent\*.*
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0\macros
 | 
					
						
							| 
									
										
										
										
											2019-03-26 23:02:46 +01:00
										 |  |  | 	File /r ${VIMRT}\macros\*.*
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0\pack
 | 
					
						
							|  |  |  | 	File /r ${VIMRT}\pack\*.*
 | 
					
						
							| 
									
										
										
										
											2018-05-10 21:24:35 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SetOutPath $0\plugin
 | 
					
						
							|  |  |  | 	File ${VIMRT}\plugin\*.*
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-25 21:46:12 +00:00
										 |  |  | 	SetOutPath $0\autoload
 | 
					
						
							| 
									
										
										
										
											2022-08-24 18:08:00 +01:00
										 |  |  | 	File /r ${VIMRT}\autoload\*.*
 | 
					
						
							| 
									
										
										
										
											2006-04-12 21:52:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-06 18:08:52 +01:00
										 |  |  | 	SetOutPath $0\import\dist
 | 
					
						
							|  |  |  | 	File ${VIMRT}\import\dist\*.*
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-11 15:24:11 +00:00
										 |  |  | 	SetOutPath $0\bitmaps
 | 
					
						
							|  |  |  | 	File ${VIMSRC}\vim.ico
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SetOutPath $0\syntax
 | 
					
						
							| 
									
										
										
										
											2022-08-24 18:08:00 +01:00
										 |  |  | 	File /r ${VIMRT}\syntax\*.*
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-24 22:21:52 +00:00
										 |  |  | 	SetOutPath $0\spell
 | 
					
						
							|  |  |  | 	File ${VIMRT}\spell\*.txt
 | 
					
						
							|  |  |  | 	File ${VIMRT}\spell\*.vim
 | 
					
						
							|  |  |  | 	File ${VIMRT}\spell\*.spl
 | 
					
						
							|  |  |  | 	File ${VIMRT}\spell\*.sug
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SetOutPath $0\tools
 | 
					
						
							|  |  |  | 	File ${VIMRT}\tools\*.*
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0\tutor
 | 
					
						
							|  |  |  | 	File ${VIMRT}\tutor\*.*
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | Section "$(str_section_console)" id_section_console
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SectionIn 1 3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	File /oname=vim.exe ${VIMSRC}\vimw32.exe
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	StrCpy $2 "$2 vim view vimdiff"
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | Section "$(str_section_batch)" id_section_batch
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SectionIn 3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	StrCpy $1 "$1 -create-batfiles $2"
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | SectionGroup $(str_group_icons) id_group_icons
 | 
					
						
							|  |  |  | 	Section "$(str_section_desktop)" id_section_desktop
 | 
					
						
							|  |  |  | 		SectionIn 1 3
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 		StrCpy $1 "$1 -install-icons"
 | 
					
						
							|  |  |  | 	SectionEnd
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	Section "$(str_section_start_menu)" id_section_startmenu
 | 
					
						
							|  |  |  | 		SectionIn 1 3
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 		StrCpy $1 "$1 -add-start-menu"
 | 
					
						
							|  |  |  | 	SectionEnd
 | 
					
						
							|  |  |  | SectionGroupEnd
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | Section "$(str_section_edit_with)" id_section_editwith
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SectionIn 1 3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0
 | 
					
						
							| 
									
										
										
										
											2017-10-14 19:05:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-24 21:34:22 +02:00
										 |  |  | 	${If} ${RunningX64}
 | 
					
						
							| 
									
										
										
										
											2017-10-14 19:05:44 +02:00
										 |  |  | 	  # Install 64-bit gvimext.dll into the GvimExt64 directory.
 | 
					
						
							|  |  |  | 	  SetOutPath $0\GvimExt64
 | 
					
						
							|  |  |  | 	  ClearErrors
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	  !define LIBRARY_SHELL_EXTENSION
 | 
					
						
							|  |  |  | 	  !define LIBRARY_X64
 | 
					
						
							|  |  |  | 	  !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "${VIMSRC}\GvimExt\gvimext64.dll" \
 | 
					
						
							|  |  |  | 	      "$0\GvimExt64\gvimext.dll" "$0"
 | 
					
						
							|  |  |  | 	  !undef LIBRARY_X64
 | 
					
						
							|  |  |  | 	  !undef LIBRARY_SHELL_EXTENSION
 | 
					
						
							| 
									
										
										
										
											2010-05-24 21:34:22 +02:00
										 |  |  | 	${EndIf}
 | 
					
						
							| 
									
										
										
										
											2017-10-14 19:05:44 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# Install 32-bit gvimext.dll into the GvimExt32 directory.
 | 
					
						
							|  |  |  | 	SetOutPath $0\GvimExt32
 | 
					
						
							|  |  |  | 	ClearErrors
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	!define LIBRARY_SHELL_EXTENSION
 | 
					
						
							|  |  |  | 	!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	    "${VIMSRC}\GvimExt\gvimext.dll" \
 | 
					
						
							|  |  |  | 	    "$0\GvimExt32\gvimext.dll" "$0"
 | 
					
						
							|  |  |  | 	!undef LIBRARY_SHELL_EXTENSION
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# We don't have a separate entry for the "Open With..." menu, assume
 | 
					
						
							|  |  |  | 	# the user wants either both or none.
 | 
					
						
							|  |  |  | 	StrCpy $1 "$1 -install-popup -install-openwith"
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | Section "$(str_section_vim_rc)" id_section_vimrc
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SectionIn 1 3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	StrCpy $1 "$1 -create-vimrc"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	  SetRegView 64
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_compat" "$vim_compat_stat"
 | 
					
						
							|  |  |  | 	WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_keyremap" "$vim_keymap_stat"
 | 
					
						
							|  |  |  | 	WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_mouse" "$vim_mouse_stat"
 | 
					
						
							|  |  |  | 	${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	  SetRegView lastused
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${If} $vim_compat_stat == "vi"
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-compat vi"
 | 
					
						
							|  |  |  | 	${ElseIf} $vim_compat_stat == "vim"
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-compat vim"
 | 
					
						
							|  |  |  | 	${ElseIf} $vim_compat_stat == "defaults"
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-compat defaults"
 | 
					
						
							|  |  |  | 	${Else}
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-compat all"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${If} $vim_keymap_stat == "default"
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-remap no"
 | 
					
						
							|  |  |  | 	${Else}
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-remap win"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${If} $vim_mouse_stat == "default"
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-behave default"
 | 
					
						
							|  |  |  | 	${ElseIf} $vim_mouse_stat == "windows"
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-behave mswin"
 | 
					
						
							|  |  |  | 	${Else}
 | 
					
						
							|  |  |  | 	  StrCpy $1 "$1 -vimrc-behave unix"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | SectionGroup $(str_group_plugin) id_group_plugin
 | 
					
						
							|  |  |  | 	Section "$(str_section_plugin_home)" id_section_pluginhome
 | 
					
						
							|  |  |  | 		SectionIn 1 3
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 		StrCpy $1 "$1 -create-directories home"
 | 
					
						
							|  |  |  | 	SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Section "$(str_section_plugin_vim)" id_section_pluginvim
 | 
					
						
							|  |  |  | 		SectionIn 3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		StrCpy $1 "$1 -create-directories vim"
 | 
					
						
							|  |  |  | 	SectionEnd
 | 
					
						
							|  |  |  | SectionGroupEnd
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !ifdef HAVE_VIS_VIM
 | 
					
						
							|  |  |  | Section "$(str_section_vis_vim)" id_section_visvim
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	SectionIn 3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	SetOutPath $0
 | 
					
						
							|  |  |  | 	!insertmacro UpgradeDLL "${VIMSRC}\VisVim\VisVim.dll" "$0\VisVim.dll" "$0"
 | 
					
						
							|  |  |  | 	File ${VIMSRC}\VisVim\README_VisVim.txt
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							|  |  |  | !ifdef HAVE_NLS
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | Section "$(str_section_nls)" id_section_nls
 | 
					
						
							|  |  |  | 	SectionIn 1 3
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	SetOutPath $0\lang
 | 
					
						
							|  |  |  | 	File /r ${VIMRT}\lang\*.*
 | 
					
						
							|  |  |  | 	SetOutPath $0\keymap
 | 
					
						
							|  |  |  | 	File ${VIMRT}\keymap\README.txt
 | 
					
						
							|  |  |  | 	File ${VIMRT}\keymap\*.vim
 | 
					
						
							|  |  |  | 	SetOutPath $0
 | 
					
						
							|  |  |  | 	!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	    "${GETTEXT}\gettext${BIT}\libintl-8.dll" \
 | 
					
						
							|  |  |  | 	    "$0\libintl-8.dll" "$0"
 | 
					
						
							|  |  |  | 	!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	    "${GETTEXT}\gettext${BIT}\libiconv-2.dll" \
 | 
					
						
							|  |  |  | 	    "$0\libiconv-2.dll" "$0"
 | 
					
						
							|  |  |  |   !if /FileExists "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll"
 | 
					
						
							|  |  |  | 	# Install libgcc_s_sjlj-1.dll only if it is needed.
 | 
					
						
							|  |  |  | 	!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	    "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" \
 | 
					
						
							|  |  |  | 	    "$0\libgcc_s_sjlj-1.dll" "$0"
 | 
					
						
							|  |  |  |   !endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${If} ${SectionIsSelected} ${id_section_editwith}
 | 
					
						
							|  |  |  | 	  ${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	    # Install DLLs for 64-bit gvimext.dll into the GvimExt64 directory.
 | 
					
						
							|  |  |  | 	    SetOutPath $0\GvimExt64
 | 
					
						
							|  |  |  | 	    ClearErrors
 | 
					
						
							|  |  |  | 	    !define LIBRARY_X64
 | 
					
						
							|  |  |  | 	    !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 		"${GETTEXT}\gettext64\libintl-8.dll" \
 | 
					
						
							|  |  |  | 		"$0\GvimExt64\libintl-8.dll" "$0\GvimExt64"
 | 
					
						
							|  |  |  | 	    !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 		"${GETTEXT}\gettext64\libiconv-2.dll" \
 | 
					
						
							|  |  |  | 		"$0\GvimExt64\libiconv-2.dll" "$0\GvimExt64"
 | 
					
						
							|  |  |  | 	    !undef LIBRARY_X64
 | 
					
						
							|  |  |  | 	  ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	  # Install DLLs for 32-bit gvimext.dll into the GvimExt32 directory.
 | 
					
						
							|  |  |  | 	  SetOutPath $0\GvimExt32
 | 
					
						
							|  |  |  | 	  ClearErrors
 | 
					
						
							|  |  |  | 	  !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "${GETTEXT}\gettext32\libintl-8.dll" \
 | 
					
						
							|  |  |  | 	      "$0\GvimExt32\libintl-8.dll" "$0\GvimExt32"
 | 
					
						
							|  |  |  | 	  !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "${GETTEXT}\gettext32\libiconv-2.dll" \
 | 
					
						
							|  |  |  | 	      "$0\GvimExt32\libiconv-2.dll" "$0\GvimExt32"
 | 
					
						
							|  |  |  |   !if /FileExists "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll"
 | 
					
						
							|  |  |  | 	  # Install libgcc_s_sjlj-1.dll only if it is needed.
 | 
					
						
							|  |  |  | 	  !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll" \
 | 
					
						
							|  |  |  | 	      "$0\GvimExt32\libgcc_s_sjlj-1.dll" "$0\GvimExt32"
 | 
					
						
							|  |  |  |   !endif
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | !endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							|  |  |  | Section -call_install_exe
 | 
					
						
							|  |  |  | 	SetOutPath $0
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	DetailPrint "$(str_msg_registering)"
 | 
					
						
							|  |  |  | 	nsExec::Exec "$0\install.exe $1"
 | 
					
						
							|  |  |  | 	Pop $3
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !macro SaveSectionSelection section_id reg_value
 | 
					
						
							|  |  |  | 	${If} ${SectionIsSelected} ${section_id}
 | 
					
						
							|  |  |  | 	  WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" ${reg_value} 1
 | 
					
						
							|  |  |  | 	${Else}
 | 
					
						
							|  |  |  | 	  WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" ${reg_value} 0
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | !macroend
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | Section -post
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# Get estimated install size
 | 
					
						
							|  |  |  | 	SectionGetSize ${id_section_exe} $3
 | 
					
						
							|  |  |  | 	${If} ${SectionIsSelected} ${id_section_console}
 | 
					
						
							|  |  |  | 	  SectionGetSize ${id_section_console} $4
 | 
					
						
							|  |  |  | 	  IntOp $3 $3 + $4
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	${If} ${SectionIsSelected} ${id_section_editwith}
 | 
					
						
							|  |  |  | 	  SectionGetSize ${id_section_editwith} $4
 | 
					
						
							|  |  |  | 	  IntOp $3 $3 + $4
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | !ifdef HAVE_VIS_VIM
 | 
					
						
							|  |  |  | 	${If} ${SectionIsSelected} ${id_section_visvim}
 | 
					
						
							|  |  |  | 	  SectionGetSize ${id_section_visvim} $4
 | 
					
						
							|  |  |  | 	  IntOp $3 $3 + $4
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | !ifdef HAVE_NLS
 | 
					
						
							|  |  |  | 	${If} ${SectionIsSelected} ${id_section_nls}
 | 
					
						
							|  |  |  | 	  SectionGetSize ${id_section_nls} $4
 | 
					
						
							|  |  |  | 	  IntOp $3 $3 + $4
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# Register EstimatedSize and AllowSilent.
 | 
					
						
							|  |  |  | 	# Other information will be set by the install.exe (dosinst.c).
 | 
					
						
							|  |  |  | 	${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	  SetRegView 64
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" "EstimatedSize" $3
 | 
					
						
							|  |  |  | 	WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" "AllowSilent" 1
 | 
					
						
							|  |  |  | 	${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	  SetRegView lastused
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# Store the selections to the registry.
 | 
					
						
							|  |  |  | 	${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	  SetRegView 64
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_console}    "select_console"
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_batch}      "select_batch"
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_desktop}    "select_desktop"
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_startmenu}  "select_startmenu"
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_editwith}   "select_editwith"
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_vimrc}      "select_vimrc"
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_pluginhome} "select_pluginhome"
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_pluginvim}  "select_pluginvim"
 | 
					
						
							|  |  |  | !ifdef HAVE_VIS_VIM
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_visvim}     "select_visvim"
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | !ifdef HAVE_NLS
 | 
					
						
							|  |  |  | 	!insertmacro SaveSectionSelection ${id_section_nls}        "select_nls"
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | 	${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	  SetRegView lastused
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	BringToFront
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | ##########################################################
 | 
					
						
							|  |  |  | !macro LoadSectionSelection section_id reg_value
 | 
					
						
							|  |  |  | 	ClearErrors
 | 
					
						
							|  |  |  | 	ReadRegDWORD $3 HKLM "${UNINST_REG_KEY_VIM}" ${reg_value}
 | 
					
						
							|  |  |  | 	${IfNot} ${Errors}
 | 
					
						
							|  |  |  | 	  ${If} $3 = 1
 | 
					
						
							|  |  |  | 	    !insertmacro SelectSection ${section_id}
 | 
					
						
							|  |  |  | 	  ${Else}
 | 
					
						
							|  |  |  | 	    !insertmacro UnselectSection ${section_id}
 | 
					
						
							|  |  |  | 	  ${EndIf}
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | !macroend
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  | !macro LoadDefaultVimrc out_var reg_value default_value
 | 
					
						
							|  |  |  | 	ClearErrors
 | 
					
						
							|  |  |  | 	ReadRegStr ${out_var} HKLM "${UNINST_REG_KEY_VIM}" ${reg_value}
 | 
					
						
							|  |  |  | 	${If} ${Errors}
 | 
					
						
							|  |  |  | 	${OrIf} ${out_var} == ""
 | 
					
						
							|  |  |  | 	  StrCpy ${out_var} ${default_value}
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | !macroend
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | Function .onInit
 | 
					
						
							|  |  |  | !ifdef HAVE_MULTI_LANG
 | 
					
						
							|  |  |  |   # Select a language (or read from the registry).
 | 
					
						
							|  |  |  |   !insertmacro MUI_LANGDLL_DISPLAY
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-24 21:19:42 +02:00
										 |  |  |   ${If} $INSTDIR == ${DEFAULT_INSTDIR}
 | 
					
						
							|  |  |  |     # Check $VIM
 | 
					
						
							|  |  |  |     ReadEnvStr $3 "VIM"
 | 
					
						
							|  |  |  |     ${If} $3 != ""
 | 
					
						
							|  |  |  |       StrCpy $INSTDIR $3
 | 
					
						
							|  |  |  |     ${EndIf}
 | 
					
						
							|  |  |  |   ${EndIf}
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   call CheckOldVim
 | 
					
						
							|  |  |  |   Pop $3
 | 
					
						
							|  |  |  |   ${If} $3 == ""
 | 
					
						
							|  |  |  |     # No old versions of Vim found. Unselect and hide the section.
 | 
					
						
							|  |  |  |     !insertmacro UnselectSection ${id_section_old_ver}
 | 
					
						
							|  |  |  |     SectionSetInstTypes ${id_section_old_ver} 0
 | 
					
						
							|  |  |  |     SectionSetText ${id_section_old_ver} ""
 | 
					
						
							|  |  |  |   ${Else}
 | 
					
						
							| 
									
										
										
										
											2021-07-24 21:19:42 +02:00
										 |  |  |     ${If} $INSTDIR == ${DEFAULT_INSTDIR}
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  |       StrCpy $INSTDIR $3
 | 
					
						
							|  |  |  |     ${EndIf}
 | 
					
						
							|  |  |  |   ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ${If} ${RunningX64}
 | 
					
						
							|  |  |  |     SetRegView 64
 | 
					
						
							|  |  |  |   ${EndIf}
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  |   # Load the selections from the registry (if any).
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  |   !insertmacro LoadSectionSelection ${id_section_console}    "select_console"
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_batch}      "select_batch"
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_desktop}    "select_desktop"
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_startmenu}  "select_startmenu"
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_editwith}   "select_editwith"
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_vimrc}      "select_vimrc"
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_pluginhome} "select_pluginhome"
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_pluginvim}  "select_pluginvim"
 | 
					
						
							|  |  |  | !ifdef HAVE_VIS_VIM
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_visvim}     "select_visvim"
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | !ifdef HAVE_NLS
 | 
					
						
							|  |  |  |   !insertmacro LoadSectionSelection ${id_section_nls}        "select_nls"
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  |   # Load the default _vimrc settings from the registry (if any).
 | 
					
						
							|  |  |  |   !insertmacro LoadDefaultVimrc $vim_compat_stat "vim_compat" "all"
 | 
					
						
							|  |  |  |   !insertmacro LoadDefaultVimrc $vim_keymap_stat "vim_keyremap" "default"
 | 
					
						
							|  |  |  |   !insertmacro LoadDefaultVimrc $vim_mouse_stat "vim_mouse" "default"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  |   ${If} ${RunningX64}
 | 
					
						
							|  |  |  |     SetRegView lastused
 | 
					
						
							|  |  |  |   ${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # User variables:
 | 
					
						
							|  |  |  |   # $0 - holds the directory the executables are installed to
 | 
					
						
							|  |  |  |   # $1 - holds the parameters to be passed to install.exe.  Starts with OLE
 | 
					
						
							|  |  |  |   #      registration (since a non-OLE gvim will not complain, and we want to
 | 
					
						
							|  |  |  |   #      always register an OLE gvim).
 | 
					
						
							|  |  |  |   # $2 - holds the names to create batch files for
 | 
					
						
							|  |  |  |   StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
 | 
					
						
							|  |  |  |   StrCpy $1 "-register-OLE"
 | 
					
						
							|  |  |  |   StrCpy $2 "gvim evim gview gvimdiff vimtutor"
 | 
					
						
							|  |  |  | FunctionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Function .onInstSuccess
 | 
					
						
							|  |  |  |   WriteUninstaller vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe
 | 
					
						
							|  |  |  | FunctionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Function .onInstFailed
 | 
					
						
							|  |  |  |   MessageBox MB_OK|MB_ICONEXCLAMATION "$(str_msg_install_fail)" /SD IDOK
 | 
					
						
							|  |  |  | FunctionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | ##########################################################
 | 
					
						
							|  |  |  | Function SetCustom
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	# Display the _vimrc setting dialog using nsDialogs.
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# Check if a _vimrc should be created
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${IfNot} ${SectionIsSelected} ${id_section_vimrc}
 | 
					
						
							|  |  |  | 	  Abort
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	!insertmacro MUI_HEADER_TEXT \
 | 
					
						
							|  |  |  | 	    $(str_vimrc_page_title) $(str_vimrc_page_subtitle)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	nsDialogs::Create 1018
 | 
					
						
							|  |  |  | 	Pop $vim_dialog
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${If} $vim_dialog == error
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | 	  Abort
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	  SetRegView 64
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	GetFunctionAddress $3 ValidateCustom
 | 
					
						
							|  |  |  | 	nsDialogs::OnBack $3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# 1st group - Compatibility
 | 
					
						
							|  |  |  | 	${NSD_CreateGroupBox} 0 0 100% 32% $(str_msg_compat_title)
 | 
					
						
							|  |  |  | 	Pop $3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${NSD_CreateLabel} 5% 10% 35% 8% $(str_msg_compat_desc)
 | 
					
						
							|  |  |  | 	Pop $3
 | 
					
						
							|  |  |  | 	${NSD_CreateDropList} 18% 19% 75% 8% ""
 | 
					
						
							|  |  |  | 	Pop $vim_nsd_compat
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_vi)
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_vim)
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_defaults)
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_all)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  | 	${If} $vim_compat_stat == "defaults"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	  StrCpy $4 2
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  | 	${ElseIf} $vim_compat_stat == "vim"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	  StrCpy $4 1
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  | 	${ElseIf} $vim_compat_stat == "vi"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	  StrCpy $4 0
 | 
					
						
							|  |  |  | 	${Else} # default
 | 
					
						
							|  |  |  | 	  StrCpy $4 3
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	${NSD_CB_SetSelectionIndex} $vim_nsd_compat $4
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# 2nd group - Key remapping
 | 
					
						
							|  |  |  | 	${NSD_CreateGroupBox} 0 35% 100% 31% $(str_msg_keymap_title)
 | 
					
						
							|  |  |  | 	Pop $3
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${NSD_CreateLabel} 5% 45% 90% 8% $(str_msg_keymap_desc)
 | 
					
						
							|  |  |  | 	Pop $3
 | 
					
						
							|  |  |  | 	${NSD_CreateDropList} 38% 54% 55% 8% ""
 | 
					
						
							|  |  |  | 	Pop $vim_nsd_keymap
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_default)
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_windows)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  | 	${If} $vim_keymap_stat == "windows"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	  StrCpy $4 1
 | 
					
						
							|  |  |  | 	${Else} # default
 | 
					
						
							|  |  |  | 	  StrCpy $4 0
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	${NSD_CB_SetSelectionIndex} $vim_nsd_keymap $4
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	# 3rd group - Mouse behavior
 | 
					
						
							|  |  |  | 	${NSD_CreateGroupBox} 0 69% 100% 31% $(str_msg_mouse_title)
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | 	Pop $3
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	${NSD_CreateLabel} 5% 79% 90% 8% $(str_msg_mouse_desc)
 | 
					
						
							|  |  |  | 	Pop $3
 | 
					
						
							|  |  |  | 	${NSD_CreateDropList} 23% 87% 70% 8% ""
 | 
					
						
							|  |  |  | 	Pop $vim_nsd_mouse
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_default)
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_windows)
 | 
					
						
							|  |  |  | 	${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_unix)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  | 	${If} $vim_mouse_stat == "xterm"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	  StrCpy $4 2
 | 
					
						
							| 
									
										
										
										
											2020-07-14 22:24:40 +02:00
										 |  |  | 	${ElseIf} $vim_mouse_stat == "windows"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	  StrCpy $4 1
 | 
					
						
							|  |  |  | 	${Else} # default
 | 
					
						
							|  |  |  | 	  StrCpy $4 0
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	${NSD_CB_SetSelectionIndex} $vim_nsd_mouse $4
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	${If} ${RunningX64}
 | 
					
						
							|  |  |  | 	  SetRegView lastused
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	nsDialogs::Show
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | FunctionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Function ValidateCustom
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${NSD_CB_GetSelectionIndex} $vim_nsd_compat $3
 | 
					
						
							|  |  |  | 	${If} $3 = 0
 | 
					
						
							|  |  |  | 	  StrCpy $vim_compat_stat "vi"
 | 
					
						
							|  |  |  | 	${ElseIf} $3 = 1
 | 
					
						
							|  |  |  | 	  StrCpy $vim_compat_stat "vim"
 | 
					
						
							|  |  |  | 	${ElseIf} $3 = 2
 | 
					
						
							|  |  |  | 	  StrCpy $vim_compat_stat "defaults"
 | 
					
						
							|  |  |  | 	${Else}
 | 
					
						
							|  |  |  | 	  StrCpy $vim_compat_stat "all"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${NSD_CB_GetSelectionIndex} $vim_nsd_keymap $3
 | 
					
						
							|  |  |  | 	${If} $3 = 0
 | 
					
						
							|  |  |  | 	  StrCpy $vim_keymap_stat "default"
 | 
					
						
							|  |  |  | 	${Else}
 | 
					
						
							|  |  |  | 	  StrCpy $vim_keymap_stat "windows"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${NSD_CB_GetSelectionIndex} $vim_nsd_mouse $3
 | 
					
						
							|  |  |  | 	${If} $3 = 0
 | 
					
						
							|  |  |  | 	  StrCpy $vim_mouse_stat "default"
 | 
					
						
							|  |  |  | 	${ElseIf} $3 = 1
 | 
					
						
							|  |  |  | 	  StrCpy $vim_mouse_stat "windows"
 | 
					
						
							|  |  |  | 	${Else}
 | 
					
						
							|  |  |  | 	  StrCpy $vim_mouse_stat "xterm"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | FunctionEnd
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | ##########################################################
 | 
					
						
							|  |  |  | # Description for Installer Sections
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_old_ver}     $(str_desc_old_ver)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_exe}         $(str_desc_exe)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_console}     $(str_desc_console)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_batch}       $(str_desc_batch)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_group_icons}         $(str_desc_icons)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_desktop}     $(str_desc_desktop)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_startmenu}   $(str_desc_start_menu)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_editwith}    $(str_desc_edit_with)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_vimrc}       $(str_desc_vim_rc)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_group_plugin}        $(str_desc_plugin)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginhome}  $(str_desc_plugin_home)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim}   $(str_desc_plugin_vim)
 | 
					
						
							|  |  |  | !ifdef HAVE_VIS_VIM
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_visvim}      $(str_desc_vis_vim)
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | !ifdef HAVE_NLS
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_section_nls}         $(str_desc_nls)
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | !insertmacro MUI_FUNCTION_DESCRIPTION_END
 | 
					
						
							| 
									
										
										
										
											2017-10-28 18:36:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | ##########################################################
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | # Uninstaller Functions and Sections
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Function un.onInit
 | 
					
						
							|  |  |  | !ifdef HAVE_MULTI_LANG
 | 
					
						
							|  |  |  |   # Get the language from the registry.
 | 
					
						
							|  |  |  |   !insertmacro MUI_UNGETLANGUAGE
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							|  |  |  | FunctionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Section "un.$(str_unsection_register)" id_unsection_register
 | 
					
						
							|  |  |  | 	SectionIn RO
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	# Apparently $INSTDIR is set to the directory where the uninstaller is
 | 
					
						
							|  |  |  | 	# created.  Thus the "vim61" directory is included in it.
 | 
					
						
							|  |  |  | 	StrCpy $0 "$INSTDIR"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !ifdef HAVE_VIS_VIM
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	# If VisVim was installed, unregister the DLL.
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${If} ${FileExists} "$0\VisVim.dll"
 | 
					
						
							|  |  |  | 	  ExecWait "regsvr32.exe /u /s $0\VisVim.dll"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# delete the context menu entry and batch files
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	DetailPrint "$(str_msg_unregistering)"
 | 
					
						
							| 
									
										
										
										
											2019-09-27 13:08:36 +02:00
										 |  |  | 	nsExec::Exec "$0\uninstall.exe -nsis"
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	Pop $3
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# We may have been put to the background when uninstall did something.
 | 
					
						
							|  |  |  | 	BringToFront
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	# Delete the installer language setting.
 | 
					
						
							|  |  |  | 	DeleteRegKey ${MUI_LANGDLL_REGISTRY_ROOT} ${MUI_LANGDLL_REGISTRY_KEY}
 | 
					
						
							|  |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Section "un.$(str_unsection_exe)" id_unsection_exe
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	StrCpy $0 "$INSTDIR"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# Delete gettext and iconv DLLs
 | 
					
						
							|  |  |  | 	${If} ${FileExists} "$0\libiconv-2.dll"
 | 
					
						
							|  |  |  | 	  !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "$0\libiconv-2.dll"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	${If} ${FileExists} "$0\libintl-8.dll"
 | 
					
						
							|  |  |  | 	  !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "$0\libintl-8.dll"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	${If} ${FileExists} "$0\libgcc_s_sjlj-1.dll"
 | 
					
						
							|  |  |  | 	  !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "$0\libgcc_s_sjlj-1.dll"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	# Delete other DLLs
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	Delete /REBOOTOK $0\*.dll
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# Delete 64-bit GvimExt
 | 
					
						
							| 
									
										
										
										
											2017-10-14 19:05:44 +02:00
										 |  |  | 	${If} ${RunningX64}
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	  !define LIBRARY_X64
 | 
					
						
							|  |  |  | 	  ${If} ${FileExists} "$0\GvimExt64\gvimext.dll"
 | 
					
						
							|  |  |  | 	    !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 		"$0\GvimExt64\gvimext.dll"
 | 
					
						
							|  |  |  | 	  ${EndIf}
 | 
					
						
							|  |  |  | 	  ${If} ${FileExists} "$0\GvimExt64\libiconv-2.dll"
 | 
					
						
							|  |  |  | 	    !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 		"$0\GvimExt64\libiconv-2.dll"
 | 
					
						
							|  |  |  | 	  ${EndIf}
 | 
					
						
							|  |  |  | 	  ${If} ${FileExists} "$0\GvimExt64\libintl-8.dll"
 | 
					
						
							|  |  |  | 	    !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 		"$0\GvimExt64\libintl-8.dll"
 | 
					
						
							|  |  |  | 	  ${EndIf}
 | 
					
						
							|  |  |  | 	  ${If} ${FileExists} "$0\GvimExt64\libwinpthread-1.dll"
 | 
					
						
							|  |  |  | 	    !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 		"$0\GvimExt64\libwinpthread-1.dll"
 | 
					
						
							|  |  |  | 	  ${EndIf}
 | 
					
						
							|  |  |  | 	  !undef LIBRARY_X64
 | 
					
						
							|  |  |  | 	  RMDir /r $0\GvimExt64
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	# Delete 32-bit GvimExt
 | 
					
						
							|  |  |  | 	${If} ${FileExists} "$0\GvimExt32\gvimext.dll"
 | 
					
						
							|  |  |  | 	  !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "$0\GvimExt32\gvimext.dll"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	${If} ${FileExists} "$0\GvimExt32\libiconv-2.dll"
 | 
					
						
							|  |  |  | 	  !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "$0\GvimExt32\libiconv-2.dll"
 | 
					
						
							| 
									
										
										
										
											2017-10-14 19:05:44 +02:00
										 |  |  | 	${EndIf}
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${If} ${FileExists} "$0\GvimExt32\libintl-8.dll"
 | 
					
						
							|  |  |  | 	  !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "$0\GvimExt32\libintl-8.dll"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	${If} ${FileExists} "$0\GvimExt32\libgcc_s_sjlj-1.dll"
 | 
					
						
							|  |  |  | 	  !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
 | 
					
						
							|  |  |  | 	      "$0\GvimExt32\libgcc_s_sjlj-1.dll"
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | 	RMDir /r $0\GvimExt32
 | 
					
						
							| 
									
										
										
										
											2017-10-14 19:05:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	ClearErrors
 | 
					
						
							|  |  |  | 	# Remove everything but *.dll files.  Avoids that
 | 
					
						
							|  |  |  | 	# a lot remains when gvimext.dll cannot be deleted.
 | 
					
						
							| 
									
										
										
										
											2006-05-13 10:44:07 +00:00
										 |  |  | 	RMDir /r $0\autoload
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	RMDir /r $0\colors
 | 
					
						
							|  |  |  | 	RMDir /r $0\compiler
 | 
					
						
							|  |  |  | 	RMDir /r $0\doc
 | 
					
						
							|  |  |  | 	RMDir /r $0\ftplugin
 | 
					
						
							| 
									
										
										
										
											2022-05-06 18:08:52 +01:00
										 |  |  | 	RMDir /r $0\import
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	RMDir /r $0\indent
 | 
					
						
							|  |  |  | 	RMDir /r $0\macros
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	RMDir /r $0\pack
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	RMDir /r $0\plugin
 | 
					
						
							| 
									
										
										
										
											2006-05-13 10:44:07 +00:00
										 |  |  | 	RMDir /r $0\spell
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	RMDir /r $0\syntax
 | 
					
						
							|  |  |  | 	RMDir /r $0\tools
 | 
					
						
							|  |  |  | 	RMDir /r $0\tutor
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !ifdef HAVE_VIS_VIM
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	RMDir /r $0\VisVim
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | !endif
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	RMDir /r $0\lang
 | 
					
						
							|  |  |  | 	RMDir /r $0\keymap
 | 
					
						
							|  |  |  | 	Delete $0\*.exe
 | 
					
						
							|  |  |  | 	Delete $0\*.bat
 | 
					
						
							|  |  |  | 	Delete $0\*.vim
 | 
					
						
							|  |  |  | 	Delete $0\*.txt
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	${If} ${Errors}
 | 
					
						
							|  |  |  | 	  MessageBox MB_OK|MB_ICONEXCLAMATION $(str_msg_rm_exe_fail) /SD IDOK
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	# No error message if the "vim62" directory can't be removed, the
 | 
					
						
							|  |  |  | 	# gvimext.dll may still be there.
 | 
					
						
							|  |  |  | 	RMDir $0
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | SectionEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Remove "vimfiles" directory under the specified directory.
 | 
					
						
							|  |  |  | !macro RemoveVimfiles dir
 | 
					
						
							|  |  |  | 	${If} ${FileExists} ${dir}\vimfiles
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\colors
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\compiler
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\doc
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\ftdetect
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\ftplugin
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\indent
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\keymap
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\plugin
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles\syntax
 | 
					
						
							|  |  |  | 	  RMDir ${dir}\vimfiles
 | 
					
						
							|  |  |  | 	${EndIf}
 | 
					
						
							|  |  |  | !macroend
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SectionGroup "un.$(str_ungroup_plugin)" id_ungroup_plugin
 | 
					
						
							|  |  |  | 	Section /o "un.$(str_unsection_plugin_home)" id_unsection_plugin_home
 | 
					
						
							|  |  |  | 		# get the home dir
 | 
					
						
							|  |  |  | 		ReadEnvStr $0 "HOME"
 | 
					
						
							|  |  |  | 		${If} $0 == ""
 | 
					
						
							|  |  |  | 		  ReadEnvStr $0 "HOMEDRIVE"
 | 
					
						
							|  |  |  | 		  ReadEnvStr $1 "HOMEPATH"
 | 
					
						
							|  |  |  | 		  StrCpy $0 "$0$1"
 | 
					
						
							|  |  |  | 		  ${If} $0 == ""
 | 
					
						
							|  |  |  | 		    ReadEnvStr $0 "USERPROFILE"
 | 
					
						
							|  |  |  | 		  ${EndIf}
 | 
					
						
							|  |  |  | 		${EndIf}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		${If} $0 != ""
 | 
					
						
							|  |  |  | 		  !insertmacro RemoveVimfiles $0
 | 
					
						
							|  |  |  | 		${EndIf}
 | 
					
						
							|  |  |  | 	SectionEnd
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	Section "un.$(str_unsection_plugin_vim)" id_unsection_plugin_vim
 | 
					
						
							|  |  |  | 		# get the parent dir of the installation
 | 
					
						
							|  |  |  | 		Push $INSTDIR
 | 
					
						
							|  |  |  | 		Call un.GetParent
 | 
					
						
							|  |  |  | 		Pop $0
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		# if a plugin dir was created at installation remove it
 | 
					
						
							|  |  |  | 		!insertmacro RemoveVimfiles $0
 | 
					
						
							|  |  |  | 	SectionEnd
 | 
					
						
							|  |  |  | SectionGroupEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Section "un.$(str_unsection_rootdir)" id_unsection_rootdir
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 	# get the parent dir of the installation
 | 
					
						
							|  |  |  | 	Push $INSTDIR
 | 
					
						
							|  |  |  | 	Call un.GetParent
 | 
					
						
							|  |  |  | 	Pop $0
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-12 21:29:33 +02:00
										 |  |  | 	${IfNot} ${Silent}
 | 
					
						
							|  |  |  | 	  Delete $0\_vimrc
 | 
					
						
							|  |  |  | 	${Endif}
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 	RMDir $0
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | SectionEnd
 | 
					
						
							| 
									
										
										
										
											2018-12-21 16:22:50 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ##########################################################
 | 
					
						
							|  |  |  | # Description for Uninstaller Sections
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_register}    $(str_desc_unregister)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_exe}         $(str_desc_rm_exe)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_ungroup_plugin}        $(str_desc_rm_plugin)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_home} $(str_desc_rm_plugin_home)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_vim}  $(str_desc_rm_plugin_vim)
 | 
					
						
							|  |  |  |     !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_rootdir}     $(str_desc_rm_rootdir)
 | 
					
						
							|  |  |  | !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
 |