Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | # NSIS file to create a self-installing exe for Vim. |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 2 | # It requires NSIS version 3.0 or later. |
Bram Moolenaar | 0434482 | 2014-11-05 18:18:17 +0100 | [diff] [blame] | 3 | # Last Change: 2014 Nov 5 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 4 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 5 | Unicode true |
| 6 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7 | # WARNING: if you make changes to this script, look out for $0 to be valid, |
| 8 | # because uninstall deletes most files in $0. |
| 9 | |
Bram Moolenaar | ba46075 | 2013-07-04 22:35:01 +0200 | [diff] [blame] | 10 | # Location of gvim_ole.exe, vimw32.exe, GvimExt/*, etc. |
Bram Moolenaar | 286eacd | 2016-01-16 18:05:50 +0100 | [diff] [blame] | 11 | !ifndef VIMSRC |
| 12 | !define VIMSRC "..\src" |
| 13 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 14 | |
| 15 | # Location of runtime files |
Bram Moolenaar | 286eacd | 2016-01-16 18:05:50 +0100 | [diff] [blame] | 16 | !ifndef VIMRT |
| 17 | !define VIMRT ".." |
| 18 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 19 | |
| 20 | # Location of extra tools: diff.exe |
Bram Moolenaar | 286eacd | 2016-01-16 18:05:50 +0100 | [diff] [blame] | 21 | !ifndef VIMTOOLS |
| 22 | !define VIMTOOLS ..\.. |
| 23 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 24 | |
Bram Moolenaar | 6199d43 | 2017-10-14 19:05:44 +0200 | [diff] [blame] | 25 | # Location of gettext. |
| 26 | # It must contain two directories: gettext32 and gettext64. |
| 27 | # See README.txt for detail. |
| 28 | !ifndef GETTEXT |
| 29 | !define GETTEXT ${VIMRT} |
| 30 | !endif |
| 31 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 32 | # Comment the next line if you don't have UPX. |
Bram Moolenaar | 6199d43 | 2017-10-14 19:05:44 +0200 | [diff] [blame] | 33 | # Get it at https://upx.github.io/ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 34 | !define HAVE_UPX |
| 35 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 36 | # Comment the next line if you do not want to add Native Language Support |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 37 | !define HAVE_NLS |
| 38 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 39 | # Uncomment the next line if you want to include VisVim extension: |
| 40 | #!define HAVE_VIS_VIM |
| 41 | |
Bram Moolenaar | 3b0ef8c | 2020-02-12 21:03:32 +0100 | [diff] [blame] | 42 | # Comment the following line to create an English-only installer: |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 43 | !define HAVE_MULTI_LANG |
| 44 | |
| 45 | # Uncomment the next line if you want to create a 64-bit installer. |
| 46 | #!define WIN64 |
| 47 | |
Bram Moolenaar | 6c7b444 | 2016-01-02 15:44:32 +0100 | [diff] [blame] | 48 | !include gvim_version.nsh # for version number |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 49 | |
Bram Moolenaar | 9d59152 | 2019-05-26 20:49:42 +0200 | [diff] [blame] | 50 | # Definition of Patch for Vim |
| 51 | !ifndef PATCHLEVEL |
| 52 | !define PATCHLEVEL 0 |
| 53 | !endif |
| 54 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 55 | # ----------- No configurable settings below this line ----------- |
| 56 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 57 | !include "Library.nsh" # For DLL install |
| 58 | !ifdef HAVE_VIS_VIM |
| 59 | !include "UpgradeDLL.nsh" # for VisVim.dll |
| 60 | !endif |
| 61 | !include "LogicLib.nsh" |
| 62 | !include "MUI2.nsh" |
| 63 | !include "nsDialogs.nsh" |
| 64 | !include "Sections.nsh" |
| 65 | !include "x64.nsh" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 66 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 67 | !define PRODUCT "Vim ${VER_MAJOR}.${VER_MINOR}" |
| 68 | !define UNINST_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall" |
| 69 | !define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}" |
| 70 | |
| 71 | !ifdef WIN64 |
| 72 | Name "${PRODUCT} (x64)" |
| 73 | !else |
| 74 | Name "${PRODUCT}" |
| 75 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 76 | OutFile gvim${VER_MAJOR}${VER_MINOR}.exe |
| 77 | CRCCheck force |
Bram Moolenaar | 286eacd | 2016-01-16 18:05:50 +0100 | [diff] [blame] | 78 | SetCompressor /SOLID lzma |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 79 | SetCompressorDictSize 64 |
| 80 | ManifestDPIAware true |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 81 | SetDatablockOptimize on |
Bram Moolenaar | 442b422 | 2010-05-24 21:34:22 +0200 | [diff] [blame] | 82 | RequestExecutionLevel highest |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 83 | |
| 84 | !ifdef HAVE_UPX |
| 85 | !packhdr temp.dat "upx --best --compress-icons=1 temp.dat" |
| 86 | !endif |
| 87 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 88 | !ifdef WIN64 |
| 89 | !define BIT 64 |
| 90 | !else |
| 91 | !define BIT 32 |
| 92 | !endif |
| 93 | |
| 94 | ########################################################## |
| 95 | # MUI2 settings |
| 96 | |
| 97 | !define MUI_ABORTWARNING |
| 98 | !define MUI_UNABORTWARNING |
| 99 | |
| 100 | !define MUI_ICON "icons\vim_16c.ico" |
| 101 | !define MUI_UNICON "icons\vim_uninst_16c.ico" |
| 102 | |
| 103 | # Show all languages, despite user's codepage: |
| 104 | !define MUI_LANGDLL_ALLLANGUAGES |
| 105 | !define MUI_LANGDLL_REGISTRY_ROOT "HKCU" |
| 106 | !define MUI_LANGDLL_REGISTRY_KEY "Software\Vim" |
| 107 | !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" |
| 108 | |
| 109 | !define MUI_WELCOMEFINISHPAGE_BITMAP "icons\welcome.bmp" |
| 110 | !define MUI_UNWELCOMEFINISHPAGE_BITMAP "icons\uninstall.bmp" |
| 111 | !define MUI_HEADERIMAGE |
| 112 | !define MUI_HEADERIMAGE_BITMAP "icons\header.bmp" |
| 113 | !define MUI_HEADERIMAGE_UNBITMAP "icons\un_header.bmp" |
| 114 | |
| 115 | !define MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH "AspectFitHeight" |
| 116 | !define MUI_UNWELCOMEFINISHPAGE_BITMAP_STRETCH "AspectFitHeight" |
| 117 | !define MUI_HEADERIMAGE_BITMAP_STRETCH "AspectFitHeight" |
| 118 | !define MUI_HEADERIMAGE_UNBITMAP_STRETCH "AspectFitHeight" |
| 119 | |
| 120 | !define MUI_COMPONENTSPAGE_SMALLDESC |
| 121 | !define MUI_LICENSEPAGE_CHECKBOX |
| 122 | !define MUI_FINISHPAGE_RUN "$0\gvim.exe" |
| 123 | !define MUI_FINISHPAGE_RUN_TEXT $(str_show_readme) |
| 124 | !define MUI_FINISHPAGE_RUN_PARAMETERS "-R $\"$0\README.txt$\"" |
| 125 | |
| 126 | # This adds '\Vim' to the user choice automagically. The actual value is |
| 127 | # obtained below with CheckOldVim. |
| 128 | !ifdef WIN64 |
| 129 | InstallDir "$PROGRAMFILES64\Vim" |
| 130 | !else |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 131 | InstallDir "$PROGRAMFILES\Vim" |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 132 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 133 | |
| 134 | # Types of installs we can perform: |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 135 | InstType $(str_type_typical) |
| 136 | InstType $(str_type_minimal) |
| 137 | InstType $(str_type_full) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 138 | |
| 139 | SilentInstall normal |
| 140 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 141 | # General custom functions for MUI2: |
| 142 | #!define MUI_CUSTOMFUNCTION_ABORT VimOnUserAbort |
| 143 | #!define MUI_CUSTOMFUNCTION_UNABORT un.VimOnUserAbort |
| 144 | |
| 145 | # Installer pages |
| 146 | !insertmacro MUI_PAGE_WELCOME |
| 147 | !insertmacro MUI_PAGE_LICENSE "${VIMRT}\doc\uganda.nsis.txt" |
| 148 | !insertmacro MUI_PAGE_COMPONENTS |
| 149 | Page custom SetCustom ValidateCustom |
| 150 | #!define MUI_PAGE_CUSTOMFUNCTION_LEAVE VimFinalCheck |
| 151 | !insertmacro MUI_PAGE_DIRECTORY |
| 152 | !insertmacro MUI_PAGE_INSTFILES |
| 153 | !define MUI_FINISHPAGE_NOREBOOTSUPPORT |
| 154 | !insertmacro MUI_PAGE_FINISH |
| 155 | |
| 156 | # Uninstaller pages: |
| 157 | !insertmacro MUI_UNPAGE_CONFIRM |
| 158 | #!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.VimCheckRunning |
| 159 | !insertmacro MUI_UNPAGE_COMPONENTS |
| 160 | !insertmacro MUI_UNPAGE_INSTFILES |
| 161 | !define MUI_FINISHPAGE_NOREBOOTSUPPORT |
| 162 | !insertmacro MUI_UNPAGE_FINISH |
| 163 | |
| 164 | ########################################################## |
| 165 | # Languages Files |
| 166 | |
| 167 | !insertmacro MUI_RESERVEFILE_LANGDLL |
| 168 | !include "lang\english.nsi" |
| 169 | |
| 170 | # Include support for other languages: |
| 171 | !ifdef HAVE_MULTI_LANG |
| 172 | !include "lang\danish.nsi" |
| 173 | !include "lang\dutch.nsi" |
| 174 | !include "lang\german.nsi" |
| 175 | !include "lang\italian.nsi" |
| 176 | !include "lang\japanese.nsi" |
| 177 | !include "lang\simpchinese.nsi" |
| 178 | !include "lang\tradchinese.nsi" |
Bram Moolenaar | 1a928c2 | 2020-01-18 16:10:40 +0100 | [diff] [blame] | 179 | !include "lang\turkish.nsi" |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 180 | !endif |
| 181 | |
Bram Moolenaar | dabfde0 | 2019-05-17 12:37:27 +0200 | [diff] [blame] | 182 | ########################################################## |
| 183 | # Version resources |
| 184 | |
| 185 | VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Vim" |
| 186 | VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Vim Developers" |
| 187 | VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim" |
| 188 | VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996" |
| 189 | VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Vi Improved - A Text Editor" |
Bram Moolenaar | 9d59152 | 2019-05-26 20:49:42 +0200 | [diff] [blame] | 190 | VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0" |
| 191 | VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0" |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 192 | |
| 193 | # Global variables |
| 194 | Var vim_dialog |
| 195 | Var vim_nsd_compat |
| 196 | Var vim_nsd_keymap |
| 197 | Var vim_nsd_mouse |
| 198 | Var vim_compat_stat |
| 199 | Var vim_keymap_stat |
| 200 | Var vim_mouse_stat |
| 201 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 202 | |
Bram Moolenaar | 5d42474 | 2018-02-04 19:11:30 +0100 | [diff] [blame] | 203 | # Reserve files |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 204 | ReserveFile ${VIMSRC}\installw32.exe |
Bram Moolenaar | 5d42474 | 2018-02-04 19:11:30 +0100 | [diff] [blame] | 205 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 206 | ########################################################## |
| 207 | # Functions |
| 208 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 209 | # Get parent directory |
| 210 | # Share this function both on installer and uninstaller |
| 211 | !macro GetParent un |
| 212 | Function ${un}GetParent |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 213 | Exch $0 ; old $0 is on top of stack |
| 214 | Push $1 |
| 215 | Push $2 |
| 216 | StrCpy $1 -1 |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 217 | ${Do} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 218 | StrCpy $2 $0 1 $1 |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 219 | ${If} $2 == "" |
| 220 | ${OrIf} $2 == "\" |
| 221 | ${ExitDo} |
| 222 | ${EndIf} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 223 | IntOp $1 $1 - 1 |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 224 | ${Loop} |
| 225 | StrCpy $0 $0 $1 |
| 226 | Pop $2 |
| 227 | Pop $1 |
| 228 | Exch $0 ; put $0 on top of stack, restore $0 to original value |
| 229 | FunctionEnd |
| 230 | !macroend |
| 231 | |
| 232 | !insertmacro GetParent "" |
| 233 | !insertmacro GetParent "un." |
| 234 | |
| 235 | # Check if Vim is already installed. |
| 236 | # return: Installed directory. If not found, it will be empty. |
| 237 | Function CheckOldVim |
| 238 | Push $0 |
| 239 | Push $R0 |
| 240 | Push $R1 |
| 241 | Push $R2 |
| 242 | |
| 243 | ${If} ${RunningX64} |
| 244 | SetRegView 64 |
| 245 | ${EndIf} |
| 246 | |
| 247 | ClearErrors |
| 248 | StrCpy $0 "" # Installed directory |
| 249 | StrCpy $R0 0 # Sub-key index |
| 250 | StrCpy $R1 "" # Sub-key |
| 251 | ${Do} |
| 252 | # Eumerate the sub-key: |
| 253 | EnumRegKey $R1 HKLM ${UNINST_REG_KEY} $R0 |
| 254 | |
| 255 | # Stop if no more sub-key: |
| 256 | ${If} ${Errors} |
| 257 | ${OrIf} $R1 == "" |
| 258 | ${ExitDo} |
| 259 | ${EndIf} |
| 260 | |
| 261 | # Move to the next sub-key: |
| 262 | IntOp $R0 $R0 + 1 |
| 263 | |
| 264 | # Check if the key is Vim uninstall key or not: |
| 265 | StrCpy $R2 $R1 4 |
| 266 | ${If} $R2 S!= "Vim " |
| 267 | ${Continue} |
| 268 | ${EndIf} |
| 269 | |
| 270 | # Verifies required sub-keys: |
| 271 | ReadRegStr $R2 HKLM "${UNINST_REG_KEY}\$R1" "DisplayName" |
| 272 | ${If} ${Errors} |
| 273 | ${OrIf} $R2 == "" |
| 274 | ${Continue} |
| 275 | ${EndIf} |
| 276 | |
| 277 | ReadRegStr $R2 HKLM "${UNINST_REG_KEY}\$R1" "UninstallString" |
| 278 | ${If} ${Errors} |
| 279 | ${OrIf} $R2 == "" |
| 280 | ${Continue} |
| 281 | ${EndIf} |
| 282 | |
| 283 | # Found |
| 284 | Push $R2 |
| 285 | call GetParent |
| 286 | call GetParent |
| 287 | Pop $0 # Vim directory |
| 288 | ${ExitDo} |
| 289 | |
| 290 | ${Loop} |
| 291 | |
| 292 | ${If} ${RunningX64} |
| 293 | SetRegView lastused |
| 294 | ${EndIf} |
| 295 | |
| 296 | Pop $R2 |
| 297 | Pop $R1 |
| 298 | Pop $R0 |
| 299 | Exch $0 # put $0 on top of stack, restore $0 to original value |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 300 | FunctionEnd |
| 301 | |
| 302 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 303 | Section "$(str_section_old_ver)" id_section_old_ver |
| 304 | SectionIn 1 2 3 RO |
| 305 | |
| 306 | # run the install program to check for already installed versions |
| 307 | SetOutPath $TEMP |
| 308 | File /oname=install.exe ${VIMSRC}\installw32.exe |
| 309 | DetailPrint "$(str_msg_uninstalling)" |
| 310 | ${Do} |
| 311 | nsExec::Exec "$TEMP\install.exe -uninstall-check" |
| 312 | Pop $3 |
| 313 | |
| 314 | call CheckOldVim |
| 315 | Pop $3 |
| 316 | ${If} $3 == "" |
| 317 | ${ExitDo} |
| 318 | ${Else} |
| 319 | # It seems that the old version is still remaining. |
| 320 | # TODO: Should we show a warning and run the uninstaller again? |
| 321 | |
| 322 | ${ExitDo} # Just ignore for now. |
| 323 | ${EndIf} |
| 324 | ${Loop} |
| 325 | Delete $TEMP\install.exe |
| 326 | Delete $TEMP\vimini.ini # install.exe creates this, but we don't need it. |
| 327 | |
| 328 | # We may have been put to the background when uninstall did something. |
| 329 | BringToFront |
| 330 | SectionEnd |
| 331 | |
| 332 | ########################################################## |
| 333 | Section "$(str_section_exe)" id_section_exe |
Bram Moolenaar | 49150a4 | 2017-09-17 21:00:03 +0200 | [diff] [blame] | 334 | SectionIn 1 2 3 RO |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 335 | |
| 336 | # we need also this here if the user changes the instdir |
| 337 | StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}" |
| 338 | |
| 339 | SetOutPath $0 |
| 340 | File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe |
Bram Moolenaar | afde13b | 2019-04-28 19:46:49 +0200 | [diff] [blame] | 341 | !if /FileExists "${VIMSRC}\vim${BIT}.dll" |
| 342 | File ${VIMSRC}\vim${BIT}.dll |
| 343 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 344 | File /oname=install.exe ${VIMSRC}\installw32.exe |
Bram Moolenaar | 30e8e73 | 2019-09-27 13:08:36 +0200 | [diff] [blame] | 345 | File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 346 | File ${VIMSRC}\vimrun.exe |
Bram Moolenaar | fec246d | 2016-08-28 18:47:14 +0200 | [diff] [blame] | 347 | File /oname=tee.exe ${VIMSRC}\teew32.exe |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 348 | File /oname=xxd.exe ${VIMSRC}\xxdw32.exe |
Bram Moolenaar | 1916673 | 2018-12-21 17:59:33 +0100 | [diff] [blame] | 349 | File ..\vimtutor.bat |
| 350 | File ..\README.txt |
Bram Moolenaar | 30e8e73 | 2019-09-27 13:08:36 +0200 | [diff] [blame] | 351 | File ..\uninstall.txt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 352 | File ${VIMRT}\*.vim |
| 353 | File ${VIMRT}\rgb.txt |
| 354 | |
Bram Moolenaar | 98ebd2b | 2017-08-19 13:29:19 +0200 | [diff] [blame] | 355 | File ${VIMTOOLS}\diff.exe |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 356 | File ${VIMTOOLS}\winpty${BIT}.dll |
Bram Moolenaar | 98ebd2b | 2017-08-19 13:29:19 +0200 | [diff] [blame] | 357 | File ${VIMTOOLS}\winpty-agent.exe |
| 358 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 359 | SetOutPath $0\colors |
| 360 | File ${VIMRT}\colors\*.* |
| 361 | |
| 362 | SetOutPath $0\compiler |
| 363 | File ${VIMRT}\compiler\*.* |
| 364 | |
| 365 | SetOutPath $0\doc |
| 366 | File ${VIMRT}\doc\*.txt |
| 367 | File ${VIMRT}\doc\tags |
| 368 | |
| 369 | SetOutPath $0\ftplugin |
| 370 | File ${VIMRT}\ftplugin\*.* |
| 371 | |
| 372 | SetOutPath $0\indent |
| 373 | File ${VIMRT}\indent\*.* |
| 374 | |
| 375 | SetOutPath $0\macros |
Bram Moolenaar | 6a95c88 | 2019-03-26 23:02:46 +0100 | [diff] [blame] | 376 | File /r ${VIMRT}\macros\*.* |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 377 | |
Bram Moolenaar | 6a95c88 | 2019-03-26 23:02:46 +0100 | [diff] [blame] | 378 | SetOutPath $0\pack |
| 379 | File /r ${VIMRT}\pack\*.* |
Bram Moolenaar | 38623c8 | 2018-05-10 21:24:35 +0200 | [diff] [blame] | 380 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 381 | SetOutPath $0\plugin |
| 382 | File ${VIMRT}\plugin\*.* |
| 383 | |
Bram Moolenaar | 7fcab2a | 2006-03-25 21:46:12 +0000 | [diff] [blame] | 384 | SetOutPath $0\autoload |
| 385 | File ${VIMRT}\autoload\*.* |
| 386 | |
Bram Moolenaar | d09a206 | 2017-11-11 15:37:45 +0100 | [diff] [blame] | 387 | SetOutPath $0\autoload\dist |
| 388 | File ${VIMRT}\autoload\dist\*.* |
| 389 | |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 390 | SetOutPath $0\autoload\xml |
| 391 | File ${VIMRT}\autoload\xml\*.* |
| 392 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 393 | SetOutPath $0\syntax |
| 394 | File ${VIMRT}\syntax\*.* |
| 395 | |
Bram Moolenaar | c01140a | 2006-03-24 22:21:52 +0000 | [diff] [blame] | 396 | SetOutPath $0\spell |
| 397 | File ${VIMRT}\spell\*.txt |
| 398 | File ${VIMRT}\spell\*.vim |
| 399 | File ${VIMRT}\spell\*.spl |
| 400 | File ${VIMRT}\spell\*.sug |
| 401 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 402 | SetOutPath $0\tools |
| 403 | File ${VIMRT}\tools\*.* |
| 404 | |
| 405 | SetOutPath $0\tutor |
| 406 | File ${VIMRT}\tutor\*.* |
| 407 | SectionEnd |
| 408 | |
| 409 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 410 | Section "$(str_section_console)" id_section_console |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 411 | SectionIn 1 3 |
| 412 | |
| 413 | SetOutPath $0 |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 414 | File /oname=vim.exe ${VIMSRC}\vimw32.exe |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 415 | StrCpy $2 "$2 vim view vimdiff" |
| 416 | SectionEnd |
| 417 | |
| 418 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 419 | Section "$(str_section_batch)" id_section_batch |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 420 | SectionIn 3 |
| 421 | |
| 422 | StrCpy $1 "$1 -create-batfiles $2" |
| 423 | SectionEnd |
| 424 | |
| 425 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 426 | SectionGroup $(str_group_icons) id_group_icons |
| 427 | Section "$(str_section_desktop)" id_section_desktop |
| 428 | SectionIn 1 3 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 429 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 430 | StrCpy $1 "$1 -install-icons" |
| 431 | SectionEnd |
| 432 | |
| 433 | Section "$(str_section_start_menu)" id_section_startmenu |
| 434 | SectionIn 1 3 |
| 435 | |
| 436 | StrCpy $1 "$1 -add-start-menu" |
| 437 | SectionEnd |
| 438 | SectionGroupEnd |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 439 | |
| 440 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 441 | Section "$(str_section_edit_with)" id_section_editwith |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 442 | SectionIn 1 3 |
| 443 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 444 | SetOutPath $0 |
Bram Moolenaar | 6199d43 | 2017-10-14 19:05:44 +0200 | [diff] [blame] | 445 | |
Bram Moolenaar | 442b422 | 2010-05-24 21:34:22 +0200 | [diff] [blame] | 446 | ${If} ${RunningX64} |
Bram Moolenaar | 6199d43 | 2017-10-14 19:05:44 +0200 | [diff] [blame] | 447 | # Install 64-bit gvimext.dll into the GvimExt64 directory. |
| 448 | SetOutPath $0\GvimExt64 |
| 449 | ClearErrors |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 450 | !define LIBRARY_SHELL_EXTENSION |
| 451 | !define LIBRARY_X64 |
| 452 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 453 | "${VIMSRC}\GvimExt\gvimext64.dll" \ |
| 454 | "$0\GvimExt64\gvimext.dll" "$0" |
| 455 | !undef LIBRARY_X64 |
| 456 | !undef LIBRARY_SHELL_EXTENSION |
Bram Moolenaar | 442b422 | 2010-05-24 21:34:22 +0200 | [diff] [blame] | 457 | ${EndIf} |
Bram Moolenaar | 6199d43 | 2017-10-14 19:05:44 +0200 | [diff] [blame] | 458 | |
Bram Moolenaar | 6199d43 | 2017-10-14 19:05:44 +0200 | [diff] [blame] | 459 | # Install 32-bit gvimext.dll into the GvimExt32 directory. |
| 460 | SetOutPath $0\GvimExt32 |
| 461 | ClearErrors |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 462 | !define LIBRARY_SHELL_EXTENSION |
| 463 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 464 | "${VIMSRC}\GvimExt\gvimext.dll" \ |
| 465 | "$0\GvimExt32\gvimext.dll" "$0" |
| 466 | !undef LIBRARY_SHELL_EXTENSION |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 467 | |
| 468 | # We don't have a separate entry for the "Open With..." menu, assume |
| 469 | # the user wants either both or none. |
| 470 | StrCpy $1 "$1 -install-popup -install-openwith" |
| 471 | SectionEnd |
| 472 | |
| 473 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 474 | Section "$(str_section_vim_rc)" id_section_vimrc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 475 | SectionIn 1 3 |
| 476 | |
| 477 | StrCpy $1 "$1 -create-vimrc" |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 478 | |
| 479 | ${If} ${RunningX64} |
| 480 | SetRegView 64 |
| 481 | ${EndIf} |
| 482 | WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_compat" "$vim_compat_stat" |
| 483 | WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_keyremap" "$vim_keymap_stat" |
| 484 | WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_mouse" "$vim_mouse_stat" |
| 485 | ${If} ${RunningX64} |
| 486 | SetRegView lastused |
| 487 | ${EndIf} |
| 488 | |
| 489 | ${If} $vim_compat_stat == "vi" |
| 490 | StrCpy $1 "$1 -vimrc-compat vi" |
| 491 | ${ElseIf} $vim_compat_stat == "vim" |
| 492 | StrCpy $1 "$1 -vimrc-compat vim" |
| 493 | ${ElseIf} $vim_compat_stat == "defaults" |
| 494 | StrCpy $1 "$1 -vimrc-compat defaults" |
| 495 | ${Else} |
| 496 | StrCpy $1 "$1 -vimrc-compat all" |
| 497 | ${EndIf} |
| 498 | |
| 499 | ${If} $vim_keymap_stat == "default" |
| 500 | StrCpy $1 "$1 -vimrc-remap no" |
| 501 | ${Else} |
| 502 | StrCpy $1 "$1 -vimrc-remap win" |
| 503 | ${EndIf} |
| 504 | |
| 505 | ${If} $vim_mouse_stat == "default" |
| 506 | StrCpy $1 "$1 -vimrc-behave default" |
| 507 | ${ElseIf} $vim_mouse_stat == "windows" |
| 508 | StrCpy $1 "$1 -vimrc-behave mswin" |
| 509 | ${Else} |
| 510 | StrCpy $1 "$1 -vimrc-behave unix" |
| 511 | ${EndIf} |
| 512 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 513 | SectionEnd |
| 514 | |
| 515 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 516 | SectionGroup $(str_group_plugin) id_group_plugin |
| 517 | Section "$(str_section_plugin_home)" id_section_pluginhome |
| 518 | SectionIn 1 3 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 519 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 520 | StrCpy $1 "$1 -create-directories home" |
| 521 | SectionEnd |
| 522 | |
| 523 | Section "$(str_section_plugin_vim)" id_section_pluginvim |
| 524 | SectionIn 3 |
| 525 | |
| 526 | StrCpy $1 "$1 -create-directories vim" |
| 527 | SectionEnd |
| 528 | SectionGroupEnd |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 529 | |
| 530 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 531 | !ifdef HAVE_VIS_VIM |
| 532 | Section "$(str_section_vis_vim)" id_section_visvim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 533 | SectionIn 3 |
| 534 | |
| 535 | SetOutPath $0 |
| 536 | !insertmacro UpgradeDLL "${VIMSRC}\VisVim\VisVim.dll" "$0\VisVim.dll" "$0" |
| 537 | File ${VIMSRC}\VisVim\README_VisVim.txt |
| 538 | SectionEnd |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 539 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 540 | |
| 541 | ########################################################## |
| 542 | !ifdef HAVE_NLS |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 543 | Section "$(str_section_nls)" id_section_nls |
| 544 | SectionIn 1 3 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 545 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 546 | SetOutPath $0\lang |
| 547 | File /r ${VIMRT}\lang\*.* |
| 548 | SetOutPath $0\keymap |
| 549 | File ${VIMRT}\keymap\README.txt |
| 550 | File ${VIMRT}\keymap\*.vim |
| 551 | SetOutPath $0 |
| 552 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 553 | "${GETTEXT}\gettext${BIT}\libintl-8.dll" \ |
| 554 | "$0\libintl-8.dll" "$0" |
| 555 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 556 | "${GETTEXT}\gettext${BIT}\libiconv-2.dll" \ |
| 557 | "$0\libiconv-2.dll" "$0" |
| 558 | !if /FileExists "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" |
| 559 | # Install libgcc_s_sjlj-1.dll only if it is needed. |
| 560 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 561 | "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" \ |
| 562 | "$0\libgcc_s_sjlj-1.dll" "$0" |
| 563 | !endif |
| 564 | |
| 565 | ${If} ${SectionIsSelected} ${id_section_editwith} |
| 566 | ${If} ${RunningX64} |
| 567 | # Install DLLs for 64-bit gvimext.dll into the GvimExt64 directory. |
| 568 | SetOutPath $0\GvimExt64 |
| 569 | ClearErrors |
| 570 | !define LIBRARY_X64 |
| 571 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 572 | "${GETTEXT}\gettext64\libintl-8.dll" \ |
| 573 | "$0\GvimExt64\libintl-8.dll" "$0\GvimExt64" |
| 574 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 575 | "${GETTEXT}\gettext64\libiconv-2.dll" \ |
| 576 | "$0\GvimExt64\libiconv-2.dll" "$0\GvimExt64" |
| 577 | !undef LIBRARY_X64 |
| 578 | ${EndIf} |
| 579 | |
| 580 | # Install DLLs for 32-bit gvimext.dll into the GvimExt32 directory. |
| 581 | SetOutPath $0\GvimExt32 |
| 582 | ClearErrors |
| 583 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 584 | "${GETTEXT}\gettext32\libintl-8.dll" \ |
| 585 | "$0\GvimExt32\libintl-8.dll" "$0\GvimExt32" |
| 586 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 587 | "${GETTEXT}\gettext32\libiconv-2.dll" \ |
| 588 | "$0\GvimExt32\libiconv-2.dll" "$0\GvimExt32" |
| 589 | !if /FileExists "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll" |
| 590 | # Install libgcc_s_sjlj-1.dll only if it is needed. |
| 591 | !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 592 | "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll" \ |
| 593 | "$0\GvimExt32\libgcc_s_sjlj-1.dll" "$0\GvimExt32" |
| 594 | !endif |
| 595 | ${EndIf} |
| 596 | SectionEnd |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 597 | !endif |
| 598 | |
| 599 | ########################################################## |
| 600 | Section -call_install_exe |
| 601 | SetOutPath $0 |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 602 | DetailPrint "$(str_msg_registering)" |
| 603 | nsExec::Exec "$0\install.exe $1" |
| 604 | Pop $3 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 605 | SectionEnd |
| 606 | |
| 607 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 608 | !macro SaveSectionSelection section_id reg_value |
| 609 | ${If} ${SectionIsSelected} ${section_id} |
| 610 | WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" ${reg_value} 1 |
| 611 | ${Else} |
| 612 | WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" ${reg_value} 0 |
| 613 | ${EndIf} |
| 614 | !macroend |
| 615 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 616 | Section -post |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 617 | |
| 618 | # Get estimated install size |
| 619 | SectionGetSize ${id_section_exe} $3 |
| 620 | ${If} ${SectionIsSelected} ${id_section_console} |
| 621 | SectionGetSize ${id_section_console} $4 |
| 622 | IntOp $3 $3 + $4 |
| 623 | ${EndIf} |
| 624 | ${If} ${SectionIsSelected} ${id_section_editwith} |
| 625 | SectionGetSize ${id_section_editwith} $4 |
| 626 | IntOp $3 $3 + $4 |
| 627 | ${EndIf} |
| 628 | !ifdef HAVE_VIS_VIM |
| 629 | ${If} ${SectionIsSelected} ${id_section_visvim} |
| 630 | SectionGetSize ${id_section_visvim} $4 |
| 631 | IntOp $3 $3 + $4 |
| 632 | ${EndIf} |
| 633 | !endif |
| 634 | !ifdef HAVE_NLS |
| 635 | ${If} ${SectionIsSelected} ${id_section_nls} |
| 636 | SectionGetSize ${id_section_nls} $4 |
| 637 | IntOp $3 $3 + $4 |
| 638 | ${EndIf} |
| 639 | !endif |
| 640 | |
| 641 | # Register EstimatedSize and AllowSilent. |
| 642 | # Other information will be set by the install.exe (dosinst.c). |
| 643 | ${If} ${RunningX64} |
| 644 | SetRegView 64 |
| 645 | ${EndIf} |
| 646 | WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" "EstimatedSize" $3 |
| 647 | WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" "AllowSilent" 1 |
| 648 | ${If} ${RunningX64} |
| 649 | SetRegView lastused |
| 650 | ${EndIf} |
| 651 | |
| 652 | # Store the selections to the registry. |
| 653 | ${If} ${RunningX64} |
| 654 | SetRegView 64 |
| 655 | ${EndIf} |
| 656 | !insertmacro SaveSectionSelection ${id_section_console} "select_console" |
| 657 | !insertmacro SaveSectionSelection ${id_section_batch} "select_batch" |
| 658 | !insertmacro SaveSectionSelection ${id_section_desktop} "select_desktop" |
| 659 | !insertmacro SaveSectionSelection ${id_section_startmenu} "select_startmenu" |
| 660 | !insertmacro SaveSectionSelection ${id_section_editwith} "select_editwith" |
| 661 | !insertmacro SaveSectionSelection ${id_section_vimrc} "select_vimrc" |
| 662 | !insertmacro SaveSectionSelection ${id_section_pluginhome} "select_pluginhome" |
| 663 | !insertmacro SaveSectionSelection ${id_section_pluginvim} "select_pluginvim" |
| 664 | !ifdef HAVE_VIS_VIM |
| 665 | !insertmacro SaveSectionSelection ${id_section_visvim} "select_visvim" |
| 666 | !endif |
| 667 | !ifdef HAVE_NLS |
| 668 | !insertmacro SaveSectionSelection ${id_section_nls} "select_nls" |
| 669 | !endif |
| 670 | ${If} ${RunningX64} |
| 671 | SetRegView lastused |
| 672 | ${EndIf} |
| 673 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 674 | BringToFront |
| 675 | SectionEnd |
| 676 | |
| 677 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 678 | !macro LoadSectionSelection section_id reg_value |
| 679 | ClearErrors |
| 680 | ReadRegDWORD $3 HKLM "${UNINST_REG_KEY_VIM}" ${reg_value} |
| 681 | ${IfNot} ${Errors} |
| 682 | ${If} $3 = 1 |
| 683 | !insertmacro SelectSection ${section_id} |
| 684 | ${Else} |
| 685 | !insertmacro UnselectSection ${section_id} |
| 686 | ${EndIf} |
| 687 | ${EndIf} |
| 688 | !macroend |
Bram Moolenaar | c3fdf7f | 2017-10-28 18:36:48 +0200 | [diff] [blame] | 689 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 690 | Function .onInit |
| 691 | !ifdef HAVE_MULTI_LANG |
| 692 | # Select a language (or read from the registry). |
| 693 | !insertmacro MUI_LANGDLL_DISPLAY |
| 694 | !endif |
Bram Moolenaar | c3fdf7f | 2017-10-28 18:36:48 +0200 | [diff] [blame] | 695 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 696 | # Check $VIM |
| 697 | ReadEnvStr $INSTDIR "VIM" |
| 698 | |
| 699 | call CheckOldVim |
| 700 | Pop $3 |
| 701 | ${If} $3 == "" |
| 702 | # No old versions of Vim found. Unselect and hide the section. |
| 703 | !insertmacro UnselectSection ${id_section_old_ver} |
| 704 | SectionSetInstTypes ${id_section_old_ver} 0 |
| 705 | SectionSetText ${id_section_old_ver} "" |
| 706 | ${Else} |
| 707 | ${If} $INSTDIR == "" |
| 708 | StrCpy $INSTDIR $3 |
| 709 | ${EndIf} |
| 710 | ${EndIf} |
| 711 | |
| 712 | # If did not find a path: use the default dir. |
| 713 | ${If} $INSTDIR == "" |
| 714 | !ifdef WIN64 |
| 715 | StrCpy $INSTDIR "$PROGRAMFILES64\Vim" |
| 716 | !else |
| 717 | StrCpy $INSTDIR "$PROGRAMFILES\Vim" |
| 718 | !endif |
| 719 | ${EndIf} |
| 720 | |
| 721 | # Load the selections from the registry (if any). |
| 722 | ${If} ${RunningX64} |
| 723 | SetRegView 64 |
| 724 | ${EndIf} |
| 725 | !insertmacro LoadSectionSelection ${id_section_console} "select_console" |
| 726 | !insertmacro LoadSectionSelection ${id_section_batch} "select_batch" |
| 727 | !insertmacro LoadSectionSelection ${id_section_desktop} "select_desktop" |
| 728 | !insertmacro LoadSectionSelection ${id_section_startmenu} "select_startmenu" |
| 729 | !insertmacro LoadSectionSelection ${id_section_editwith} "select_editwith" |
| 730 | !insertmacro LoadSectionSelection ${id_section_vimrc} "select_vimrc" |
| 731 | !insertmacro LoadSectionSelection ${id_section_pluginhome} "select_pluginhome" |
| 732 | !insertmacro LoadSectionSelection ${id_section_pluginvim} "select_pluginvim" |
| 733 | !ifdef HAVE_VIS_VIM |
| 734 | !insertmacro LoadSectionSelection ${id_section_visvim} "select_visvim" |
| 735 | !endif |
| 736 | !ifdef HAVE_NLS |
| 737 | !insertmacro LoadSectionSelection ${id_section_nls} "select_nls" |
| 738 | !endif |
| 739 | ${If} ${RunningX64} |
| 740 | SetRegView lastused |
| 741 | ${EndIf} |
| 742 | |
| 743 | # User variables: |
| 744 | # $0 - holds the directory the executables are installed to |
| 745 | # $1 - holds the parameters to be passed to install.exe. Starts with OLE |
| 746 | # registration (since a non-OLE gvim will not complain, and we want to |
| 747 | # always register an OLE gvim). |
| 748 | # $2 - holds the names to create batch files for |
| 749 | StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}" |
| 750 | StrCpy $1 "-register-OLE" |
| 751 | StrCpy $2 "gvim evim gview gvimdiff vimtutor" |
Bram Moolenaar | c3fdf7f | 2017-10-28 18:36:48 +0200 | [diff] [blame] | 752 | FunctionEnd |
| 753 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 754 | Function .onInstSuccess |
| 755 | WriteUninstaller vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe |
| 756 | FunctionEnd |
Bram Moolenaar | c3fdf7f | 2017-10-28 18:36:48 +0200 | [diff] [blame] | 757 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 758 | Function .onInstFailed |
| 759 | MessageBox MB_OK|MB_ICONEXCLAMATION "$(str_msg_install_fail)" /SD IDOK |
Bram Moolenaar | c3fdf7f | 2017-10-28 18:36:48 +0200 | [diff] [blame] | 760 | FunctionEnd |
| 761 | |
| 762 | ########################################################## |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 763 | Function SetCustom |
| 764 | # Display the _vimrc setting dialog using nsDialogs. |
| 765 | |
| 766 | # Check if a _vimrc should be created |
| 767 | ${IfNot} ${SectionIsSelected} ${id_section_vimrc} |
| 768 | Abort |
| 769 | ${EndIf} |
| 770 | |
| 771 | !insertmacro MUI_HEADER_TEXT \ |
| 772 | $(str_vimrc_page_title) $(str_vimrc_page_subtitle) |
| 773 | |
| 774 | nsDialogs::Create 1018 |
| 775 | Pop $vim_dialog |
| 776 | |
| 777 | ${If} $vim_dialog == error |
| 778 | Abort |
| 779 | ${EndIf} |
| 780 | |
| 781 | ${If} ${RunningX64} |
| 782 | SetRegView 64 |
| 783 | ${EndIf} |
| 784 | |
| 785 | GetFunctionAddress $3 ValidateCustom |
| 786 | nsDialogs::OnBack $3 |
| 787 | |
| 788 | |
| 789 | # 1st group - Compatibility |
| 790 | ${NSD_CreateGroupBox} 0 0 100% 32% $(str_msg_compat_title) |
| 791 | Pop $3 |
| 792 | |
| 793 | ${NSD_CreateLabel} 5% 10% 35% 8% $(str_msg_compat_desc) |
| 794 | Pop $3 |
| 795 | ${NSD_CreateDropList} 18% 19% 75% 8% "" |
| 796 | Pop $vim_nsd_compat |
| 797 | ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_vi) |
| 798 | ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_vim) |
| 799 | ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_defaults) |
| 800 | ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_all) |
| 801 | |
| 802 | # Default selection |
| 803 | ${If} $vim_compat_stat == "" |
| 804 | ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_compat" |
| 805 | ${Else} |
| 806 | StrCpy $3 $vim_compat_stat |
| 807 | ${EndIf} |
| 808 | ${If} $3 == "defaults" |
| 809 | StrCpy $4 2 |
| 810 | ${ElseIf} $3 == "vim" |
| 811 | StrCpy $4 1 |
| 812 | ${ElseIf} $3 == "vi" |
| 813 | StrCpy $4 0 |
| 814 | ${Else} # default |
| 815 | StrCpy $4 3 |
| 816 | ${EndIf} |
| 817 | ${NSD_CB_SetSelectionIndex} $vim_nsd_compat $4 |
| 818 | |
| 819 | |
| 820 | # 2nd group - Key remapping |
| 821 | ${NSD_CreateGroupBox} 0 35% 100% 31% $(str_msg_keymap_title) |
| 822 | Pop $3 |
| 823 | |
| 824 | ${NSD_CreateLabel} 5% 45% 90% 8% $(str_msg_keymap_desc) |
| 825 | Pop $3 |
| 826 | ${NSD_CreateDropList} 38% 54% 55% 8% "" |
| 827 | Pop $vim_nsd_keymap |
| 828 | ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_default) |
| 829 | ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_windows) |
| 830 | |
| 831 | # Default selection |
| 832 | ${If} $vim_keymap_stat == "" |
| 833 | ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_keyremap" |
| 834 | ${Else} |
| 835 | StrCpy $3 $vim_keymap_stat |
| 836 | ${EndIf} |
| 837 | ${If} $3 == "windows" |
| 838 | StrCpy $4 1 |
| 839 | ${Else} # default |
| 840 | StrCpy $4 0 |
| 841 | ${EndIf} |
| 842 | ${NSD_CB_SetSelectionIndex} $vim_nsd_keymap $4 |
| 843 | |
| 844 | |
| 845 | # 3rd group - Mouse behavior |
| 846 | ${NSD_CreateGroupBox} 0 69% 100% 31% $(str_msg_mouse_title) |
| 847 | Pop $3 |
| 848 | |
| 849 | ${NSD_CreateLabel} 5% 79% 90% 8% $(str_msg_mouse_desc) |
| 850 | Pop $3 |
| 851 | ${NSD_CreateDropList} 23% 87% 70% 8% "" |
| 852 | Pop $vim_nsd_mouse |
| 853 | ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_default) |
| 854 | ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_windows) |
| 855 | ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_unix) |
| 856 | |
| 857 | # Default selection |
| 858 | ${If} $vim_mouse_stat == "" |
| 859 | ReadRegStr $3 HKLM "${UNINST_REG_KEY_VIM}" "vim_mouse" |
| 860 | ${Else} |
| 861 | StrCpy $3 $vim_mouse_stat |
| 862 | ${EndIf} |
| 863 | ${If} $3 == "xterm" |
| 864 | StrCpy $4 2 |
| 865 | ${ElseIf} $3 == "windows" |
| 866 | StrCpy $4 1 |
| 867 | ${Else} # default |
| 868 | StrCpy $4 0 |
| 869 | ${EndIf} |
| 870 | ${NSD_CB_SetSelectionIndex} $vim_nsd_mouse $4 |
| 871 | |
| 872 | ${If} ${RunningX64} |
| 873 | SetRegView lastused |
| 874 | ${EndIf} |
| 875 | |
| 876 | nsDialogs::Show |
| 877 | FunctionEnd |
| 878 | |
| 879 | Function ValidateCustom |
| 880 | ${NSD_CB_GetSelectionIndex} $vim_nsd_compat $3 |
| 881 | ${If} $3 = 0 |
| 882 | StrCpy $vim_compat_stat "vi" |
| 883 | ${ElseIf} $3 = 1 |
| 884 | StrCpy $vim_compat_stat "vim" |
| 885 | ${ElseIf} $3 = 2 |
| 886 | StrCpy $vim_compat_stat "defaults" |
| 887 | ${Else} |
| 888 | StrCpy $vim_compat_stat "all" |
| 889 | ${EndIf} |
| 890 | |
| 891 | ${NSD_CB_GetSelectionIndex} $vim_nsd_keymap $3 |
| 892 | ${If} $3 = 0 |
| 893 | StrCpy $vim_keymap_stat "default" |
| 894 | ${Else} |
| 895 | StrCpy $vim_keymap_stat "windows" |
| 896 | ${EndIf} |
| 897 | |
| 898 | ${NSD_CB_GetSelectionIndex} $vim_nsd_mouse $3 |
| 899 | ${If} $3 = 0 |
| 900 | StrCpy $vim_mouse_stat "default" |
| 901 | ${ElseIf} $3 = 1 |
| 902 | StrCpy $vim_mouse_stat "windows" |
| 903 | ${Else} |
| 904 | StrCpy $vim_mouse_stat "xterm" |
| 905 | ${EndIf} |
| 906 | FunctionEnd |
| 907 | |
| 908 | ########################################################## |
| 909 | # Description for Installer Sections |
| 910 | |
| 911 | !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
| 912 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_old_ver} $(str_desc_old_ver) |
| 913 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_exe} $(str_desc_exe) |
| 914 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_console} $(str_desc_console) |
| 915 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_batch} $(str_desc_batch) |
| 916 | !insertmacro MUI_DESCRIPTION_TEXT ${id_group_icons} $(str_desc_icons) |
| 917 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_desktop} $(str_desc_desktop) |
| 918 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_startmenu} $(str_desc_start_menu) |
| 919 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_editwith} $(str_desc_edit_with) |
| 920 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_vimrc} $(str_desc_vim_rc) |
| 921 | !insertmacro MUI_DESCRIPTION_TEXT ${id_group_plugin} $(str_desc_plugin) |
| 922 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginhome} $(str_desc_plugin_home) |
| 923 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim} $(str_desc_plugin_vim) |
| 924 | !ifdef HAVE_VIS_VIM |
| 925 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_visvim} $(str_desc_vis_vim) |
| 926 | !endif |
| 927 | !ifdef HAVE_NLS |
| 928 | !insertmacro MUI_DESCRIPTION_TEXT ${id_section_nls} $(str_desc_nls) |
| 929 | !endif |
| 930 | !insertmacro MUI_FUNCTION_DESCRIPTION_END |
| 931 | |
| 932 | |
| 933 | ########################################################## |
| 934 | # Uninstaller Functions and Sections |
| 935 | |
| 936 | Function un.onInit |
| 937 | !ifdef HAVE_MULTI_LANG |
| 938 | # Get the language from the registry. |
| 939 | !insertmacro MUI_UNGETLANGUAGE |
| 940 | !endif |
| 941 | FunctionEnd |
| 942 | |
| 943 | Section "un.$(str_unsection_register)" id_unsection_register |
| 944 | SectionIn RO |
| 945 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 946 | # Apparently $INSTDIR is set to the directory where the uninstaller is |
| 947 | # created. Thus the "vim61" directory is included in it. |
| 948 | StrCpy $0 "$INSTDIR" |
| 949 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 950 | !ifdef HAVE_VIS_VIM |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 951 | # If VisVim was installed, unregister the DLL. |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 952 | ${If} ${FileExists} "$0\VisVim.dll" |
| 953 | ExecWait "regsvr32.exe /u /s $0\VisVim.dll" |
| 954 | ${EndIf} |
| 955 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 956 | |
| 957 | # delete the context menu entry and batch files |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 958 | DetailPrint "$(str_msg_unregistering)" |
Bram Moolenaar | 30e8e73 | 2019-09-27 13:08:36 +0200 | [diff] [blame] | 959 | nsExec::Exec "$0\uninstall.exe -nsis" |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 960 | Pop $3 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 961 | |
| 962 | # We may have been put to the background when uninstall did something. |
| 963 | BringToFront |
| 964 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 965 | # Delete the installer language setting. |
| 966 | DeleteRegKey ${MUI_LANGDLL_REGISTRY_ROOT} ${MUI_LANGDLL_REGISTRY_KEY} |
| 967 | SectionEnd |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 968 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 969 | Section "un.$(str_unsection_exe)" id_unsection_exe |
| 970 | |
| 971 | StrCpy $0 "$INSTDIR" |
| 972 | |
| 973 | # Delete gettext and iconv DLLs |
| 974 | ${If} ${FileExists} "$0\libiconv-2.dll" |
| 975 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 976 | "$0\libiconv-2.dll" |
Bram Moolenaar | 6199d43 | 2017-10-14 19:05:44 +0200 | [diff] [blame] | 977 | ${EndIf} |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 978 | ${If} ${FileExists} "$0\libintl-8.dll" |
| 979 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 980 | "$0\libintl-8.dll" |
| 981 | ${EndIf} |
| 982 | ${If} ${FileExists} "$0\libgcc_s_sjlj-1.dll" |
| 983 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 984 | "$0\libgcc_s_sjlj-1.dll" |
| 985 | ${EndIf} |
| 986 | |
| 987 | # Delete other DLLs |
| 988 | Delete /REBOOTOK $0\*.dll |
| 989 | |
| 990 | # Delete 64-bit GvimExt |
| 991 | ${If} ${RunningX64} |
| 992 | !define LIBRARY_X64 |
| 993 | ${If} ${FileExists} "$0\GvimExt64\gvimext.dll" |
| 994 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 995 | "$0\GvimExt64\gvimext.dll" |
| 996 | ${EndIf} |
| 997 | ${If} ${FileExists} "$0\GvimExt64\libiconv-2.dll" |
| 998 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 999 | "$0\GvimExt64\libiconv-2.dll" |
| 1000 | ${EndIf} |
| 1001 | ${If} ${FileExists} "$0\GvimExt64\libintl-8.dll" |
| 1002 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 1003 | "$0\GvimExt64\libintl-8.dll" |
| 1004 | ${EndIf} |
| 1005 | ${If} ${FileExists} "$0\GvimExt64\libwinpthread-1.dll" |
| 1006 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 1007 | "$0\GvimExt64\libwinpthread-1.dll" |
| 1008 | ${EndIf} |
| 1009 | !undef LIBRARY_X64 |
| 1010 | RMDir /r $0\GvimExt64 |
| 1011 | ${EndIf} |
| 1012 | |
| 1013 | # Delete 32-bit GvimExt |
| 1014 | ${If} ${FileExists} "$0\GvimExt32\gvimext.dll" |
| 1015 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 1016 | "$0\GvimExt32\gvimext.dll" |
| 1017 | ${EndIf} |
| 1018 | ${If} ${FileExists} "$0\GvimExt32\libiconv-2.dll" |
| 1019 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 1020 | "$0\GvimExt32\libiconv-2.dll" |
| 1021 | ${EndIf} |
| 1022 | ${If} ${FileExists} "$0\GvimExt32\libintl-8.dll" |
| 1023 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 1024 | "$0\GvimExt32\libintl-8.dll" |
| 1025 | ${EndIf} |
| 1026 | ${If} ${FileExists} "$0\GvimExt32\libgcc_s_sjlj-1.dll" |
| 1027 | !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \ |
| 1028 | "$0\GvimExt32\libgcc_s_sjlj-1.dll" |
| 1029 | ${EndIf} |
| 1030 | RMDir /r $0\GvimExt32 |
Bram Moolenaar | 6199d43 | 2017-10-14 19:05:44 +0200 | [diff] [blame] | 1031 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1032 | ClearErrors |
| 1033 | # Remove everything but *.dll files. Avoids that |
| 1034 | # a lot remains when gvimext.dll cannot be deleted. |
Bram Moolenaar | 408b585 | 2006-05-13 10:44:07 +0000 | [diff] [blame] | 1035 | RMDir /r $0\autoload |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1036 | RMDir /r $0\colors |
| 1037 | RMDir /r $0\compiler |
| 1038 | RMDir /r $0\doc |
| 1039 | RMDir /r $0\ftplugin |
| 1040 | RMDir /r $0\indent |
| 1041 | RMDir /r $0\macros |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 1042 | RMDir /r $0\pack |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1043 | RMDir /r $0\plugin |
Bram Moolenaar | 408b585 | 2006-05-13 10:44:07 +0000 | [diff] [blame] | 1044 | RMDir /r $0\spell |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1045 | RMDir /r $0\syntax |
| 1046 | RMDir /r $0\tools |
| 1047 | RMDir /r $0\tutor |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 1048 | !ifdef HAVE_VIS_VIM |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1049 | RMDir /r $0\VisVim |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 1050 | !endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1051 | RMDir /r $0\lang |
| 1052 | RMDir /r $0\keymap |
| 1053 | Delete $0\*.exe |
| 1054 | Delete $0\*.bat |
| 1055 | Delete $0\*.vim |
| 1056 | Delete $0\*.txt |
| 1057 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 1058 | ${If} ${Errors} |
| 1059 | MessageBox MB_OK|MB_ICONEXCLAMATION $(str_msg_rm_exe_fail) /SD IDOK |
| 1060 | ${EndIf} |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1061 | |
| 1062 | # No error message if the "vim62" directory can't be removed, the |
| 1063 | # gvimext.dll may still be there. |
| 1064 | RMDir $0 |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 1065 | SectionEnd |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1066 | |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 1067 | # Remove "vimfiles" directory under the specified directory. |
| 1068 | !macro RemoveVimfiles dir |
| 1069 | ${If} ${FileExists} ${dir}\vimfiles |
| 1070 | RMDir ${dir}\vimfiles\colors |
| 1071 | RMDir ${dir}\vimfiles\compiler |
| 1072 | RMDir ${dir}\vimfiles\doc |
| 1073 | RMDir ${dir}\vimfiles\ftdetect |
| 1074 | RMDir ${dir}\vimfiles\ftplugin |
| 1075 | RMDir ${dir}\vimfiles\indent |
| 1076 | RMDir ${dir}\vimfiles\keymap |
| 1077 | RMDir ${dir}\vimfiles\plugin |
| 1078 | RMDir ${dir}\vimfiles\syntax |
| 1079 | RMDir ${dir}\vimfiles |
| 1080 | ${EndIf} |
| 1081 | !macroend |
| 1082 | |
| 1083 | SectionGroup "un.$(str_ungroup_plugin)" id_ungroup_plugin |
| 1084 | Section /o "un.$(str_unsection_plugin_home)" id_unsection_plugin_home |
| 1085 | # get the home dir |
| 1086 | ReadEnvStr $0 "HOME" |
| 1087 | ${If} $0 == "" |
| 1088 | ReadEnvStr $0 "HOMEDRIVE" |
| 1089 | ReadEnvStr $1 "HOMEPATH" |
| 1090 | StrCpy $0 "$0$1" |
| 1091 | ${If} $0 == "" |
| 1092 | ReadEnvStr $0 "USERPROFILE" |
| 1093 | ${EndIf} |
| 1094 | ${EndIf} |
| 1095 | |
| 1096 | ${If} $0 != "" |
| 1097 | !insertmacro RemoveVimfiles $0 |
| 1098 | ${EndIf} |
| 1099 | SectionEnd |
| 1100 | |
| 1101 | Section "un.$(str_unsection_plugin_vim)" id_unsection_plugin_vim |
| 1102 | # get the parent dir of the installation |
| 1103 | Push $INSTDIR |
| 1104 | Call un.GetParent |
| 1105 | Pop $0 |
| 1106 | |
| 1107 | # if a plugin dir was created at installation remove it |
| 1108 | !insertmacro RemoveVimfiles $0 |
| 1109 | SectionEnd |
| 1110 | SectionGroupEnd |
| 1111 | |
| 1112 | Section "un.$(str_unsection_rootdir)" id_unsection_rootdir |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1113 | # get the parent dir of the installation |
| 1114 | Push $INSTDIR |
| 1115 | Call un.GetParent |
| 1116 | Pop $0 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1117 | |
Bram Moolenaar | a8d22e3 | 2019-04-12 21:29:33 +0200 | [diff] [blame] | 1118 | ${IfNot} ${Silent} |
| 1119 | Delete $0\_vimrc |
| 1120 | ${Endif} |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 1121 | RMDir $0 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1122 | SectionEnd |
Bram Moolenaar | af610b8 | 2018-12-21 16:22:50 +0100 | [diff] [blame] | 1123 | |
| 1124 | ########################################################## |
| 1125 | # Description for Uninstaller Sections |
| 1126 | |
| 1127 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN |
| 1128 | !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_register} $(str_desc_unregister) |
| 1129 | !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_exe} $(str_desc_rm_exe) |
| 1130 | !insertmacro MUI_DESCRIPTION_TEXT ${id_ungroup_plugin} $(str_desc_rm_plugin) |
| 1131 | !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_home} $(str_desc_rm_plugin_home) |
| 1132 | !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_vim} $(str_desc_rm_plugin_vim) |
| 1133 | !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_rootdir} $(str_desc_rm_rootdir) |
| 1134 | !insertmacro MUI_UNFUNCTION_DESCRIPTION_END |