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