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