blob: 3ea1d15de13a3aa041d4e02357af1ea21d48b422 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001# NSIS file to create a self-installing exe for Vim.
Bram Moolenaaraf610b82018-12-21 16:22:50 +01002# It requires NSIS version 3.0 or later.
Restorer74a23312024-03-28 09:19:44 +00003# Last Change: 2024 Mar 20
Bram Moolenaar071d4272004-06-13 20:20:40 +00004
Bram Moolenaaraf610b82018-12-21 16:22:50 +01005Unicode true
6
Bram Moolenaar071d4272004-06-13 20:20:40 +00007# 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 Moolenaarba460752013-07-04 22:35:01 +020010# Location of gvim_ole.exe, vimw32.exe, GvimExt/*, etc.
Bram Moolenaar286eacd2016-01-16 18:05:50 +010011!ifndef VIMSRC
12 !define VIMSRC "..\src"
13!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000014
15# Location of runtime files
Bram Moolenaar286eacd2016-01-16 18:05:50 +010016!ifndef VIMRT
17 !define VIMRT ".."
18!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000019
Restorer51c94b62024-03-24 09:41:18 +000020# Location of extra tools: diff.exe, winpty{32|64}.dll, winpty-agent.exe, etc.
Bram Moolenaar286eacd2016-01-16 18:05:50 +010021!ifndef VIMTOOLS
22 !define VIMTOOLS ..\..
23!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000024
Bram Moolenaar6199d432017-10-14 19:05:44 +020025# 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
Restorer51c94b62024-03-24 09:41:18 +000032# If you have UPX, use the switch /DHAVE_UPX=1 on the command line makensis.exe.
33# This property will be set to 1. Get it at https://upx.github.io/
34!ifndef HAVE_UPX
35 !define HAVE_UPX 0
36!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000037
Restorer51c94b62024-03-24 09:41:18 +000038# If you do not want to add Native Language Support, use the switch /DHAVE_NLS=0
39# in the command line makensis.exe. This property will be set to 0.
40!ifndef HAVE_NLS
41 !define HAVE_NLS 1
42!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000043
Restorer51c94b62024-03-24 09:41:18 +000044# To create an English-only the installer, use the switch /DHAVE_MULTI_LANG=0 on
45# the command line makensis.exe. This property will be set to 0.
46!ifndef HAVE_MULTI_LANG
47 !define HAVE_MULTI_LANG 1
48!endif
Bram Moolenaaraf610b82018-12-21 16:22:50 +010049
Restorer51c94b62024-03-24 09:41:18 +000050# if you want to create a 64-bit the installer, use the switch /DWIN64=1 on
51# the command line makensis.exe. This property will be set to 1.
52!ifndef WIN64
53 !define WIN64 0
54!endif
Bram Moolenaaraf610b82018-12-21 16:22:50 +010055
K.Takata48f38332024-10-07 20:37:00 +020056# if you don't want to include libgcc_s_sjlj-1.dll in the package, use the
57# switch /DINCLUDE_LIBGCC=0 on the command line makensis.exe.
58!ifndef INCLUDE_LIBGCC
59 !define INCLUDE_LIBGCC 1
60!endif
61
Bram Moolenaar6c7b4442016-01-02 15:44:32 +010062!include gvim_version.nsh # for version number
Bram Moolenaar071d4272004-06-13 20:20:40 +000063
Restorer51c94b62024-03-24 09:41:18 +000064# Definition of Patch for Vim.
Bram Moolenaar9d591522019-05-26 20:49:42 +020065!ifndef PATCHLEVEL
66 !define PATCHLEVEL 0
67!endif
68
Bram Moolenaar071d4272004-06-13 20:20:40 +000069# ----------- No configurable settings below this line -----------
70
Restorer51c94b62024-03-24 09:41:18 +000071!include "Library.nsh" # for DLL install
Bram Moolenaaraf610b82018-12-21 16:22:50 +010072!include "LogicLib.nsh"
73!include "MUI2.nsh"
74!include "nsDialogs.nsh"
75!include "Sections.nsh"
76!include "x64.nsh"
Bram Moolenaar071d4272004-06-13 20:20:40 +000077
RestorerZ2680a072024-03-20 20:15:51 +010078# See https://nsis.sourceforge.io/LogicLib
79;FileExists is already part of LogicLib, but returns true for directories
80;as well as files
81!macro _FileExists2 _a _b _t _f
82 !insertmacro _LOGICLIB_TEMP
83 StrCpy $_LOGICLIB_TEMP "0"
84;if path is not blank, continue to next check
85 StrCmp `${_b}` `` +4 0
86;if path exists, continue to next check (IfFileExists returns true if this
87;is a directory)
88 IfFileExists `${_b}` `0` +3
89;if path is not a directory, continue to confirm exists
90 IfFileExists `${_b}\*.*` +2 0
91 StrCpy $_LOGICLIB_TEMP "1" ;file exists
92;now we have a definitive value - the file exists or it does not
93 StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
94!macroend
95!undef FileExists
96!define FileExists `"" FileExists2`
97!macro _DirExists _a _b _t _f
98 !insertmacro _LOGICLIB_TEMP
99 StrCpy $_LOGICLIB_TEMP "0"
100;if path is not blank, continue to next check
101 StrCmp `${_b}` `` +3 0
102;if directory exists, continue to confirm exists
103 IfFileExists `${_b}\*.*` 0 +2
104 StrCpy $_LOGICLIB_TEMP "1"
105 StrCmp $_LOGICLIB_TEMP "1" `${_t}` `${_f}`
106!macroend
107!define DirExists `"" DirExists`
108
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100109!define PRODUCT "Vim ${VER_MAJOR}.${VER_MINOR}"
110!define UNINST_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall"
111!define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}"
112
Restorer51c94b62024-03-24 09:41:18 +0000113!if ${WIN64}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100114Name "${PRODUCT} (x64)"
115!else
116Name "${PRODUCT}"
117!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118OutFile gvim${VER_MAJOR}${VER_MINOR}.exe
119CRCCheck force
Bram Moolenaar286eacd2016-01-16 18:05:50 +0100120SetCompressor /SOLID lzma
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100121SetCompressorDictSize 64
122ManifestDPIAware true
Bram Moolenaar071d4272004-06-13 20:20:40 +0000123SetDatablockOptimize on
Bram Moolenaar442b4222010-05-24 21:34:22 +0200124RequestExecutionLevel highest
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125
Restorer51c94b62024-03-24 09:41:18 +0000126!if ${HAVE_UPX}
Bram Moolenaar071d4272004-06-13 20:20:40 +0000127 !packhdr temp.dat "upx --best --compress-icons=1 temp.dat"
128!endif
129
Restorer51c94b62024-03-24 09:41:18 +0000130!if ${WIN64}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100131!define BIT 64
132!else
133!define BIT 32
134!endif
135
136##########################################################
137# MUI2 settings
138
139!define MUI_ABORTWARNING
140!define MUI_UNABORTWARNING
141
142!define MUI_ICON "icons\vim_16c.ico"
143!define MUI_UNICON "icons\vim_uninst_16c.ico"
144
145# Show all languages, despite user's codepage:
146!define MUI_LANGDLL_ALLLANGUAGES
Restorer6dcf59b2024-03-25 15:38:37 +0000147# Always show dialog choice language
148#!define MUI_LANGDLL_ALWAYSSHOW
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100149!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
150!define MUI_LANGDLL_REGISTRY_KEY "Software\Vim"
151!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
152
153!define MUI_WELCOMEFINISHPAGE_BITMAP "icons\welcome.bmp"
154!define MUI_UNWELCOMEFINISHPAGE_BITMAP "icons\uninstall.bmp"
155!define MUI_HEADERIMAGE
156!define MUI_HEADERIMAGE_BITMAP "icons\header.bmp"
157!define MUI_HEADERIMAGE_UNBITMAP "icons\un_header.bmp"
158
159!define MUI_WELCOMEFINISHPAGE_BITMAP_STRETCH "AspectFitHeight"
160!define MUI_UNWELCOMEFINISHPAGE_BITMAP_STRETCH "AspectFitHeight"
161!define MUI_HEADERIMAGE_BITMAP_STRETCH "AspectFitHeight"
162!define MUI_HEADERIMAGE_UNBITMAP_STRETCH "AspectFitHeight"
163
164!define MUI_COMPONENTSPAGE_SMALLDESC
165!define MUI_LICENSEPAGE_CHECKBOX
Restorer74a23312024-03-28 09:19:44 +0000166!define MUI_FINISHPAGE_SHOWREADME
167!define MUI_FINISHPAGE_SHOWREADME_TEXT $(str_show_readme)
168!define MUI_FINISHPAGE_SHOWREADME_FUNCTION LaunchApplication
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100169
170# This adds '\Vim' to the user choice automagically. The actual value is
171# obtained below with CheckOldVim.
Restorer51c94b62024-03-24 09:41:18 +0000172!if ${WIN64}
Christian Brabandt7d603842021-07-24 21:19:42 +0200173 !define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100174!else
Christian Brabandt7d603842021-07-24 21:19:42 +0200175 !define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100176!endif
Christian Brabandt7d603842021-07-24 21:19:42 +0200177InstallDir ${DEFAULT_INSTDIR}
Bram Moolenaar071d4272004-06-13 20:20:40 +0000178
179# Types of installs we can perform:
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100180InstType $(str_type_typical)
181InstType $(str_type_minimal)
182InstType $(str_type_full)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000183
184SilentInstall normal
185
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100186# General custom functions for MUI2:
187#!define MUI_CUSTOMFUNCTION_ABORT VimOnUserAbort
188#!define MUI_CUSTOMFUNCTION_UNABORT un.VimOnUserAbort
189
190# Installer pages
191!insertmacro MUI_PAGE_WELCOME
Restorer74a23312024-03-28 09:19:44 +0000192!insertmacro MUI_PAGE_LICENSE $(page_lic_file)
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100193!insertmacro MUI_PAGE_COMPONENTS
194Page custom SetCustom ValidateCustom
195#!define MUI_PAGE_CUSTOMFUNCTION_LEAVE VimFinalCheck
196!insertmacro MUI_PAGE_DIRECTORY
197!insertmacro MUI_PAGE_INSTFILES
198!define MUI_FINISHPAGE_NOREBOOTSUPPORT
199!insertmacro MUI_PAGE_FINISH
200
201# Uninstaller pages:
202!insertmacro MUI_UNPAGE_CONFIRM
203#!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.VimCheckRunning
204!insertmacro MUI_UNPAGE_COMPONENTS
205!insertmacro MUI_UNPAGE_INSTFILES
206!define MUI_FINISHPAGE_NOREBOOTSUPPORT
207!insertmacro MUI_UNPAGE_FINISH
208
209##########################################################
210# Languages Files
211
212!insertmacro MUI_RESERVEFILE_LANGDLL
213!include "lang\english.nsi"
214
215# Include support for other languages:
Restorer51c94b62024-03-24 09:41:18 +0000216!if ${HAVE_MULTI_LANG}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100217 !include "lang\danish.nsi"
218 !include "lang\dutch.nsi"
219 !include "lang\german.nsi"
Christos Longrosc62dacb2024-03-06 20:53:02 +0100220 !include "lang\greek.nsi"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100221 !include "lang\italian.nsi"
222 !include "lang\japanese.nsi"
Bram Moolenaar809fcec2020-09-20 21:43:03 +0200223 !include "lang\russian.nsi"
Ivan Pešiće1051922024-03-05 23:34:00 +0400224 !include "lang\serbian.nsi"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100225 !include "lang\simpchinese.nsi"
226 !include "lang\tradchinese.nsi"
Bram Moolenaar1a928c22020-01-18 16:10:40 +0100227 !include "lang\turkish.nsi"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100228!endif
229
Bram Moolenaardabfde02019-05-17 12:37:27 +0200230##########################################################
231# Version resources
232
233VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Vim"
RestorerZec67ee02024-04-25 21:25:19 +0200234VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "The Vim Project"
Bram Moolenaardabfde02019-05-17 12:37:27 +0200235VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalTrademarks" "Vim"
236VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright (C) 1996"
237VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Vi Improved - A Text Editor"
Bram Moolenaar9d591522019-05-26 20:49:42 +0200238VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
239VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${PATCHLEVEL}.0"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100240
241# Global variables
242Var vim_dialog
243Var vim_nsd_compat
244Var vim_nsd_keymap
245Var vim_nsd_mouse
246Var vim_compat_stat
247Var vim_keymap_stat
248Var vim_mouse_stat
249
Bram Moolenaar071d4272004-06-13 20:20:40 +0000250
Bram Moolenaar5d424742018-02-04 19:11:30 +0100251# Reserve files
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100252ReserveFile ${VIMSRC}\installw32.exe
Bram Moolenaar5d424742018-02-04 19:11:30 +0100253
Bram Moolenaar071d4272004-06-13 20:20:40 +0000254##########################################################
255# Functions
256
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100257# Get parent directory
258# Share this function both on installer and uninstaller
259!macro GetParent un
260Function ${un}GetParent
Bram Moolenaar071d4272004-06-13 20:20:40 +0000261 Exch $0 ; old $0 is on top of stack
262 Push $1
263 Push $2
264 StrCpy $1 -1
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100265 ${Do}
Bram Moolenaar071d4272004-06-13 20:20:40 +0000266 StrCpy $2 $0 1 $1
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100267 ${If} $2 == ""
268 ${OrIf} $2 == "\"
269 ${ExitDo}
270 ${EndIf}
Bram Moolenaar071d4272004-06-13 20:20:40 +0000271 IntOp $1 $1 - 1
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100272 ${Loop}
273 StrCpy $0 $0 $1
274 Pop $2
275 Pop $1
276 Exch $0 ; put $0 on top of stack, restore $0 to original value
277FunctionEnd
278!macroend
279
280!insertmacro GetParent ""
281!insertmacro GetParent "un."
282
Christopher Plewrighteea0a002023-02-17 20:04:51 +0000283# Get home directory
284!macro GetHomeDir un
285Function ${un}GetHomeDir
286 Push $0
287 Push $1
288 ReadEnvStr $0 "HOME"
289 ${If} $0 == ""
290 ReadEnvStr $0 "HOMEDRIVE"
291 ReadEnvStr $1 "HOMEPATH"
292 StrCpy $0 "$0$1"
293 ${If} $0 == ""
294 ReadEnvStr $0 "USERPROFILE"
295 ${EndIf}
296 ${EndIf}
297 Pop $1
298 Exch $0 # put $0 on top of stack, restore $0 to original value
299FunctionEnd
300!macroend
301
302!insertmacro GetHomeDir ""
303!insertmacro GetHomeDir "un."
304
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100305# Check if Vim is already installed.
306# return: Installed directory. If not found, it will be empty.
307Function CheckOldVim
308 Push $0
309 Push $R0
310 Push $R1
311 Push $R2
312
313 ${If} ${RunningX64}
314 SetRegView 64
315 ${EndIf}
316
317 ClearErrors
318 StrCpy $0 "" # Installed directory
319 StrCpy $R0 0 # Sub-key index
320 StrCpy $R1 "" # Sub-key
321 ${Do}
322 # Eumerate the sub-key:
323 EnumRegKey $R1 HKLM ${UNINST_REG_KEY} $R0
324
325 # Stop if no more sub-key:
326 ${If} ${Errors}
327 ${OrIf} $R1 == ""
328 ${ExitDo}
329 ${EndIf}
330
331 # Move to the next sub-key:
332 IntOp $R0 $R0 + 1
333
334 # Check if the key is Vim uninstall key or not:
335 StrCpy $R2 $R1 4
336 ${If} $R2 S!= "Vim "
337 ${Continue}
338 ${EndIf}
339
340 # Verifies required sub-keys:
341 ReadRegStr $R2 HKLM "${UNINST_REG_KEY}\$R1" "DisplayName"
342 ${If} ${Errors}
343 ${OrIf} $R2 == ""
344 ${Continue}
345 ${EndIf}
346
347 ReadRegStr $R2 HKLM "${UNINST_REG_KEY}\$R1" "UninstallString"
348 ${If} ${Errors}
349 ${OrIf} $R2 == ""
350 ${Continue}
351 ${EndIf}
352
353 # Found
354 Push $R2
355 call GetParent
356 call GetParent
357 Pop $0 # Vim directory
358 ${ExitDo}
359
360 ${Loop}
361
362 ${If} ${RunningX64}
363 SetRegView lastused
364 ${EndIf}
365
366 Pop $R2
367 Pop $R1
368 Pop $R0
369 Exch $0 # put $0 on top of stack, restore $0 to original value
Bram Moolenaar071d4272004-06-13 20:20:40 +0000370FunctionEnd
371
Bram Moolenaar4a228972021-05-01 22:41:39 +0200372Function LaunchApplication
373 SetOutPath $0
Restorer74a23312024-03-28 09:19:44 +0000374 ShellExecAsUser::ShellExecAsUser "" "$0\gvim.exe" '-R "$0\$(vim_readme_file)"'
Bram Moolenaar4a228972021-05-01 22:41:39 +0200375FunctionEnd
376
Bram Moolenaar071d4272004-06-13 20:20:40 +0000377##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100378Section "$(str_section_old_ver)" id_section_old_ver
379 SectionIn 1 2 3 RO
380
381 # run the install program to check for already installed versions
382 SetOutPath $TEMP
383 File /oname=install.exe ${VIMSRC}\installw32.exe
384 DetailPrint "$(str_msg_uninstalling)"
385 ${Do}
386 nsExec::Exec "$TEMP\install.exe -uninstall-check"
387 Pop $3
388
389 call CheckOldVim
390 Pop $3
391 ${If} $3 == ""
392 ${ExitDo}
393 ${Else}
394 # It seems that the old version is still remaining.
395 # TODO: Should we show a warning and run the uninstaller again?
396
397 ${ExitDo} # Just ignore for now.
398 ${EndIf}
399 ${Loop}
400 Delete $TEMP\install.exe
401 Delete $TEMP\vimini.ini # install.exe creates this, but we don't need it.
402
403 # We may have been put to the background when uninstall did something.
404 BringToFront
405SectionEnd
406
407##########################################################
408Section "$(str_section_exe)" id_section_exe
Bram Moolenaar49150a42017-09-17 21:00:03 +0200409 SectionIn 1 2 3 RO
Bram Moolenaar071d4272004-06-13 20:20:40 +0000410
411 # we need also this here if the user changes the instdir
412 StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
413
414 SetOutPath $0
415 File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200416!if /FileExists "${VIMSRC}\vim${BIT}.dll"
417 File ${VIMSRC}\vim${BIT}.dll
418!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000419 File /oname=install.exe ${VIMSRC}\installw32.exe
Bram Moolenaar30e8e732019-09-27 13:08:36 +0200420 File /oname=uninstall.exe ${VIMSRC}\uninstallw32.exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000421 File ${VIMSRC}\vimrun.exe
Bram Moolenaarfec246d2016-08-28 18:47:14 +0200422 File /oname=tee.exe ${VIMSRC}\teew32.exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000423 File /oname=xxd.exe ${VIMSRC}\xxdw32.exe
Bram Moolenaar19166732018-12-21 17:59:33 +0100424 File ..\vimtutor.bat
425 File ..\README.txt
Bram Moolenaar30e8e732019-09-27 13:08:36 +0200426 File ..\uninstall.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000427 File ${VIMRT}\*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000428
RestorerZ2680a072024-03-20 20:15:51 +0100429!if /FileExists "${VIMTOOLS}\diff.exe"
Bram Moolenaar98ebd2b2017-08-19 13:29:19 +0200430 File ${VIMTOOLS}\diff.exe
RestorerZ2680a072024-03-20 20:15:51 +0100431!endif
432!if /FileExists "${VIMTOOLS}\winpty${BIT}.dll"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100433 File ${VIMTOOLS}\winpty${BIT}.dll
RestorerZ2680a072024-03-20 20:15:51 +0100434!endif
435!if /FileExists "${VIMTOOLS}\winpty-agent.exe"
Bram Moolenaar98ebd2b2017-08-19 13:29:19 +0200436 File ${VIMTOOLS}\winpty-agent.exe
RestorerZ2680a072024-03-20 20:15:51 +0100437!endif
RestorerZ49f1e192024-04-09 23:04:44 +0200438!if /FileExists "${VIMTOOLS}\libsodium.dll"
439 File ${VIMTOOLS}\libsodium.dll
440!endif
Bram Moolenaar98ebd2b2017-08-19 13:29:19 +0200441
Bram Moolenaar071d4272004-06-13 20:20:40 +0000442 SetOutPath $0\colors
K.Takata44b9abb2022-08-24 18:08:00 +0100443 File /r ${VIMRT}\colors\*.*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444
445 SetOutPath $0\compiler
446 File ${VIMRT}\compiler\*.*
447
448 SetOutPath $0\doc
RestorerZ2680a072024-03-20 20:15:51 +0100449 File /x uganda.nsis.txt ${VIMRT}\doc\*.txt
Bram Moolenaar071d4272004-06-13 20:20:40 +0000450 File ${VIMRT}\doc\tags
451
452 SetOutPath $0\ftplugin
453 File ${VIMRT}\ftplugin\*.*
454
455 SetOutPath $0\indent
RestorerZ2680a072024-03-20 20:15:51 +0100456 File ${VIMRT}\indent\README.txt
457 File ${VIMRT}\indent\*.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000458
Ken Takata1a9aba82024-01-16 17:14:29 +0100459 SetOutPath $0\keymap
RestorerZ2680a072024-03-20 20:15:51 +0100460 File ${VIMRT}\keymap\README.txt
461 File ${VIMRT}\keymap\*.vim
Ken Takata1a9aba82024-01-16 17:14:29 +0100462
Bram Moolenaar071d4272004-06-13 20:20:40 +0000463 SetOutPath $0\macros
RestorerZ2680a072024-03-20 20:15:51 +0100464 File /r /x *.info ${VIMRT}\macros\*.*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000465
Bram Moolenaar6a95c882019-03-26 23:02:46 +0100466 SetOutPath $0\pack
467 File /r ${VIMRT}\pack\*.*
Bram Moolenaar38623c82018-05-10 21:24:35 +0200468
Bram Moolenaar071d4272004-06-13 20:20:40 +0000469 SetOutPath $0\plugin
470 File ${VIMRT}\plugin\*.*
471
Bram Moolenaar7fcab2a2006-03-25 21:46:12 +0000472 SetOutPath $0\autoload
K.Takata44b9abb2022-08-24 18:08:00 +0100473 File /r ${VIMRT}\autoload\*.*
Bram Moolenaar18144c82006-04-12 21:52:12 +0000474
Bram Moolenaar44433da2022-05-06 18:08:52 +0100475 SetOutPath $0\import\dist
476 File ${VIMRT}\import\dist\*.*
477
Christian Brabandt176711f2022-03-11 15:24:11 +0000478 SetOutPath $0\bitmaps
479 File ${VIMSRC}\vim.ico
480
Bram Moolenaar071d4272004-06-13 20:20:40 +0000481 SetOutPath $0\syntax
RestorerZ2680a072024-03-20 20:15:51 +0100482 File /r /x testdir /x generator /x Makefile ${VIMRT}\syntax\*.*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000483
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000484 SetOutPath $0\spell
485 File ${VIMRT}\spell\*.txt
486 File ${VIMRT}\spell\*.vim
487 File ${VIMRT}\spell\*.spl
488 File ${VIMRT}\spell\*.sug
489
Bram Moolenaar071d4272004-06-13 20:20:40 +0000490 SetOutPath $0\tools
491 File ${VIMRT}\tools\*.*
492
493 SetOutPath $0\tutor
RestorerZ2680a072024-03-20 20:15:51 +0100494 File /x Makefile /x *.info ${VIMRT}\tutor\*.*
Bram Moolenaar071d4272004-06-13 20:20:40 +0000495SectionEnd
496
497##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100498Section "$(str_section_console)" id_section_console
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499 SectionIn 1 3
500
501 SetOutPath $0
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100502 File /oname=vim.exe ${VIMSRC}\vimw32.exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000503 StrCpy $2 "$2 vim view vimdiff"
504SectionEnd
505
506##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100507Section "$(str_section_batch)" id_section_batch
Bram Moolenaar071d4272004-06-13 20:20:40 +0000508 SectionIn 3
509
510 StrCpy $1 "$1 -create-batfiles $2"
511SectionEnd
512
513##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100514SectionGroup $(str_group_icons) id_group_icons
515 Section "$(str_section_desktop)" id_section_desktop
516 SectionIn 1 3
Bram Moolenaar071d4272004-06-13 20:20:40 +0000517
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100518 StrCpy $1 "$1 -install-icons"
519 SectionEnd
520
521 Section "$(str_section_start_menu)" id_section_startmenu
522 SectionIn 1 3
523
524 StrCpy $1 "$1 -add-start-menu"
525 SectionEnd
526SectionGroupEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000527
528##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100529Section "$(str_section_edit_with)" id_section_editwith
Bram Moolenaar071d4272004-06-13 20:20:40 +0000530 SectionIn 1 3
531
Bram Moolenaar071d4272004-06-13 20:20:40 +0000532 SetOutPath $0
Bram Moolenaar6199d432017-10-14 19:05:44 +0200533
Bram Moolenaar442b4222010-05-24 21:34:22 +0200534 ${If} ${RunningX64}
Bram Moolenaar6199d432017-10-14 19:05:44 +0200535 # Install 64-bit gvimext.dll into the GvimExt64 directory.
536 SetOutPath $0\GvimExt64
537 ClearErrors
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100538 !define LIBRARY_SHELL_EXTENSION
539 !define LIBRARY_X64
540 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
541 "${VIMSRC}\GvimExt\gvimext64.dll" \
542 "$0\GvimExt64\gvimext.dll" "$0"
543 !undef LIBRARY_X64
544 !undef LIBRARY_SHELL_EXTENSION
Bram Moolenaar442b4222010-05-24 21:34:22 +0200545 ${EndIf}
Bram Moolenaar6199d432017-10-14 19:05:44 +0200546
Bram Moolenaar6199d432017-10-14 19:05:44 +0200547 # Install 32-bit gvimext.dll into the GvimExt32 directory.
548 SetOutPath $0\GvimExt32
549 ClearErrors
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100550 !define LIBRARY_SHELL_EXTENSION
551 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
552 "${VIMSRC}\GvimExt\gvimext.dll" \
553 "$0\GvimExt32\gvimext.dll" "$0"
554 !undef LIBRARY_SHELL_EXTENSION
Bram Moolenaar071d4272004-06-13 20:20:40 +0000555
556 # We don't have a separate entry for the "Open With..." menu, assume
557 # the user wants either both or none.
558 StrCpy $1 "$1 -install-popup -install-openwith"
559SectionEnd
560
561##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100562Section "$(str_section_vim_rc)" id_section_vimrc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000563 SectionIn 1 3
564
565 StrCpy $1 "$1 -create-vimrc"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100566
567 ${If} ${RunningX64}
568 SetRegView 64
569 ${EndIf}
570 WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_compat" "$vim_compat_stat"
571 WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_keyremap" "$vim_keymap_stat"
572 WriteRegStr HKLM "${UNINST_REG_KEY_VIM}" "vim_mouse" "$vim_mouse_stat"
573 ${If} ${RunningX64}
574 SetRegView lastused
575 ${EndIf}
576
577 ${If} $vim_compat_stat == "vi"
578 StrCpy $1 "$1 -vimrc-compat vi"
579 ${ElseIf} $vim_compat_stat == "vim"
580 StrCpy $1 "$1 -vimrc-compat vim"
581 ${ElseIf} $vim_compat_stat == "defaults"
582 StrCpy $1 "$1 -vimrc-compat defaults"
583 ${Else}
584 StrCpy $1 "$1 -vimrc-compat all"
585 ${EndIf}
586
587 ${If} $vim_keymap_stat == "default"
588 StrCpy $1 "$1 -vimrc-remap no"
589 ${Else}
590 StrCpy $1 "$1 -vimrc-remap win"
591 ${EndIf}
592
593 ${If} $vim_mouse_stat == "default"
594 StrCpy $1 "$1 -vimrc-behave default"
595 ${ElseIf} $vim_mouse_stat == "windows"
596 StrCpy $1 "$1 -vimrc-behave mswin"
597 ${Else}
598 StrCpy $1 "$1 -vimrc-behave unix"
599 ${EndIf}
600
Bram Moolenaar071d4272004-06-13 20:20:40 +0000601SectionEnd
602
603##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100604SectionGroup $(str_group_plugin) id_group_plugin
605 Section "$(str_section_plugin_home)" id_section_pluginhome
606 SectionIn 1 3
Bram Moolenaar071d4272004-06-13 20:20:40 +0000607
Christopher Plewrighteea0a002023-02-17 20:04:51 +0000608 # use ShellExecAsUser below instead
609 # StrCpy $1 "$1 -create-directories home"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100610 SectionEnd
611
612 Section "$(str_section_plugin_vim)" id_section_pluginvim
613 SectionIn 3
614
615 StrCpy $1 "$1 -create-directories vim"
616 SectionEnd
617SectionGroupEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000618
619##########################################################
Restorer51c94b62024-03-24 09:41:18 +0000620!if ${HAVE_NLS}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100621Section "$(str_section_nls)" id_section_nls
622 SectionIn 1 3
Bram Moolenaar071d4272004-06-13 20:20:40 +0000623
Restorer74a23312024-03-28 09:19:44 +0000624#; FIXME: When adding new translations, do not forget to make changes here.
625 SetOutPath $0
626!if /FileExists ..\README.dax.txt
627 ${If} $Language = ${LANG_DANISH}
628 File ..\README.dax.txt
629 ${EndIf}
630!endif
631!if /FileExists ..\README.nlx.txt
632 ${If} $Language = ${LANG_DUTCH}
633 File ..\README.nlx.txt
634 ${EndIf}
635!endif
636!if /FileExists ..\README.dex.txt
637 ${If} $Language = ${LANG_GERMAN}
638 File ..\README.dex.txt
639 ${EndIf}
640!endif
641!if /FileExists ..\README.itx.txt
642 ${If} $Language = ${LANG_ITALIAN}
643 File ..\README.itx.txt
644 ${EndIf}
645!endif
646!if /FileExists ..\README.jax.txt
647 ${If} $Language = ${LANG_JAPANESE}
648 File ..\README.jax.txt
649 ${EndIf}
650!endif
651!if /FileExists ..\README.rux.txt
652 ${If} $Language = ${LANG_RUSSIAN}
653 File ..\README.rux.txt
654 ${EndIf}
655!endif
656!if /FileExists ..\README.srx.txt
657 ${If} $Language = ${LANG_SERBIAN}
658 File ..\README.srx.txt
659 ${EndIf}
660!endif
661!if /FileExists ..\README.cnx.txt
662 ${If} $Language = ${LANG_SIMPCHINESE}
663 File ..\README.cnx.txt
664 ${EndIf}
665!endif
666!if /FileExists ..\README.twx.txt
667 ${If} $Language = ${LANG_TRADCHINESE}
668 File ..\README.twx.txt
669 ${EndIf}
670!endif
671!if /FileExists ..\README.trx.txt
672 ${OrIf} $Language = ${LANG_TURKISH}
673 File ..\README.trx.txt
674 ${EndIf}
675!endif
676#; FIXME: When adding new translations, do not forget to make changes here.
677 SetOutPath $0\doc
678!if /FileExists "${VIMRT}\doc\uganda.dax"
679 ${If} $Language = ${LANG_DANISH}
680 File ${VIMRT}\doc\uganda.dax
681 ${EndIf}
682!endif
683!if /FileExists "${VIMRT}\doc\uganda.nlx"
684 ${If} $Language = ${LANG_DUTCH}
685 File ${VIMRT}\doc\uganda.nlx
686 ${EndIf}
687!endif
688!if /FileExists "${VIMRT}\doc\uganda.dex"
689 ${If} $Language = ${LANG_GERMAN}
690 File ${VIMRT}\doc\uganda.dex
691 ${EndIf}
692!endif
693!if /FileExists "${VIMRT}\doc\uganda.itx"
694 ${If} $Language = ${LANG_ITALIAN}
695 File ${VIMRT}\doc\uganda.itx
696 ${EndIf}
697!endif
698!if /FileExists "${VIMRT}\doc\uganda.jax"
699 ${If} $Language = ${LANG_JAPANESE}
700 File ${VIMRT}\doc\uganda.jax
701 ${EndIf}
702!endif
703!if /FileExists "${VIMRT}\doc\uganda.rux"
704 ${If} $Language = ${LANG_RUSSIAN}
705 File ${VIMRT}\doc\uganda.rux
706 ${EndIf}
707!endif
708!if /FileExists "${VIMRT}\doc\uganda.srx"
709 ${If} $Language = ${LANG_SERBIAN}
710 File ${VIMRT}\doc\uganda.srx
711 ${EndIf}
712!endif
713!if /FileExists "${VIMRT}\doc\uganda.cnx"
714 ${If} $Language = ${LANG_SIMPCHINESE}
715 File ${VIMRT}\doc\uganda.cnx
716 ${EndIf}
717!endif
718!if /FileExists "${VIMRT}\doc\uganda.twx"
719 ${If} $Language = ${LANG_TRADCHINESE}
720 File ${VIMRT}\doc\uganda.twx
721 ${EndIf}
722!endif
723!if /FileExists "${VIMRT}\doc\uganda.trx"
724 ${If} $Language = ${LANG_TURKISH}
725 File ${VIMRT}\doc\uganda.trx
726 ${EndIf}
727!endif
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100728 SetOutPath $0\lang
RestorerZ2680a072024-03-20 20:15:51 +0100729 File /r /x Makefile ${VIMRT}\lang\*.*
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100730 SetOutPath $0
731 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
732 "${GETTEXT}\gettext${BIT}\libintl-8.dll" \
733 "$0\libintl-8.dll" "$0"
734 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
735 "${GETTEXT}\gettext${BIT}\libiconv-2.dll" \
736 "$0\libiconv-2.dll" "$0"
K.Takata48f38332024-10-07 20:37:00 +0200737!if ${INCLUDE_LIBGCC}
738!if /FileExists "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll"
739 # Install libgcc_s_sjlj-1.dll only if it is needed.
740 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
741 "${GETTEXT}\gettext${BIT}\libgcc_s_sjlj-1.dll" \
742 "$0\libgcc_s_sjlj-1.dll" "$0"
743!endif
744!endif
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100745
746 ${If} ${SectionIsSelected} ${id_section_editwith}
747 ${If} ${RunningX64}
748 # Install DLLs for 64-bit gvimext.dll into the GvimExt64 directory.
749 SetOutPath $0\GvimExt64
750 ClearErrors
751 !define LIBRARY_X64
752 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
753 "${GETTEXT}\gettext64\libintl-8.dll" \
754 "$0\GvimExt64\libintl-8.dll" "$0\GvimExt64"
755 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
756 "${GETTEXT}\gettext64\libiconv-2.dll" \
757 "$0\GvimExt64\libiconv-2.dll" "$0\GvimExt64"
758 !undef LIBRARY_X64
759 ${EndIf}
760
761 # Install DLLs for 32-bit gvimext.dll into the GvimExt32 directory.
762 SetOutPath $0\GvimExt32
763 ClearErrors
764 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
765 "${GETTEXT}\gettext32\libintl-8.dll" \
766 "$0\GvimExt32\libintl-8.dll" "$0\GvimExt32"
767 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
768 "${GETTEXT}\gettext32\libiconv-2.dll" \
769 "$0\GvimExt32\libiconv-2.dll" "$0\GvimExt32"
K.Takata48f38332024-10-07 20:37:00 +0200770!if ${INCLUDE_LIBGCC}
771!if /FileExists "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll"
772 # Install libgcc_s_sjlj-1.dll only if it is needed.
773 !insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
774 "${GETTEXT}\gettext32\libgcc_s_sjlj-1.dll" \
775 "$0\GvimExt32\libgcc_s_sjlj-1.dll" "$0\GvimExt32"
776!endif
777!endif
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100778 ${EndIf}
779SectionEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000780!endif
781
782##########################################################
783Section -call_install_exe
784 SetOutPath $0
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100785 DetailPrint "$(str_msg_registering)"
786 nsExec::Exec "$0\install.exe $1"
787 Pop $3
Christopher Plewrighteea0a002023-02-17 20:04:51 +0000788
789 ${If} ${SectionIsSelected} ${id_section_pluginhome}
790 ReadEnvStr $3 "COMSPEC"
791 Call GetHomeDir
792 Pop $4
793 ShellExecAsUser::ShellExecAsUser "" "$3" '/c "cd /d "$4" & mkdir vimfiles & cd vimfiles & mkdir colors compiler doc ftdetect ftplugin indent keymap plugin syntax"' SW_HIDE
794 ${EndIf}
Bram Moolenaar071d4272004-06-13 20:20:40 +0000795SectionEnd
796
797##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100798!macro SaveSectionSelection section_id reg_value
799 ${If} ${SectionIsSelected} ${section_id}
800 WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" ${reg_value} 1
801 ${Else}
802 WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" ${reg_value} 0
803 ${EndIf}
804!macroend
805
Bram Moolenaar071d4272004-06-13 20:20:40 +0000806Section -post
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100807
808 # Get estimated install size
809 SectionGetSize ${id_section_exe} $3
810 ${If} ${SectionIsSelected} ${id_section_console}
811 SectionGetSize ${id_section_console} $4
812 IntOp $3 $3 + $4
813 ${EndIf}
814 ${If} ${SectionIsSelected} ${id_section_editwith}
815 SectionGetSize ${id_section_editwith} $4
816 IntOp $3 $3 + $4
817 ${EndIf}
Restorer51c94b62024-03-24 09:41:18 +0000818!if ${HAVE_NLS}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100819 ${If} ${SectionIsSelected} ${id_section_nls}
820 SectionGetSize ${id_section_nls} $4
821 IntOp $3 $3 + $4
822 ${EndIf}
823!endif
824
825 # Register EstimatedSize and AllowSilent.
826 # Other information will be set by the install.exe (dosinst.c).
827 ${If} ${RunningX64}
828 SetRegView 64
829 ${EndIf}
830 WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" "EstimatedSize" $3
831 WriteRegDWORD HKLM "${UNINST_REG_KEY_VIM}" "AllowSilent" 1
832 ${If} ${RunningX64}
833 SetRegView lastused
834 ${EndIf}
835
836 # Store the selections to the registry.
837 ${If} ${RunningX64}
838 SetRegView 64
839 ${EndIf}
840 !insertmacro SaveSectionSelection ${id_section_console} "select_console"
841 !insertmacro SaveSectionSelection ${id_section_batch} "select_batch"
842 !insertmacro SaveSectionSelection ${id_section_desktop} "select_desktop"
843 !insertmacro SaveSectionSelection ${id_section_startmenu} "select_startmenu"
844 !insertmacro SaveSectionSelection ${id_section_editwith} "select_editwith"
845 !insertmacro SaveSectionSelection ${id_section_vimrc} "select_vimrc"
846 !insertmacro SaveSectionSelection ${id_section_pluginhome} "select_pluginhome"
847 !insertmacro SaveSectionSelection ${id_section_pluginvim} "select_pluginvim"
Restorer51c94b62024-03-24 09:41:18 +0000848!if ${HAVE_NLS}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100849 !insertmacro SaveSectionSelection ${id_section_nls} "select_nls"
850!endif
851 ${If} ${RunningX64}
852 SetRegView lastused
853 ${EndIf}
854
Bram Moolenaar071d4272004-06-13 20:20:40 +0000855 BringToFront
856SectionEnd
857
858##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100859!macro LoadSectionSelection section_id reg_value
860 ClearErrors
861 ReadRegDWORD $3 HKLM "${UNINST_REG_KEY_VIM}" ${reg_value}
862 ${IfNot} ${Errors}
863 ${If} $3 = 1
864 !insertmacro SelectSection ${section_id}
865 ${Else}
866 !insertmacro UnselectSection ${section_id}
867 ${EndIf}
868 ${EndIf}
869!macroend
Bram Moolenaarc3fdf7f2017-10-28 18:36:48 +0200870
Bram Moolenaarceb56dd2020-07-14 22:24:40 +0200871!macro LoadDefaultVimrc out_var reg_value default_value
872 ClearErrors
873 ReadRegStr ${out_var} HKLM "${UNINST_REG_KEY_VIM}" ${reg_value}
874 ${If} ${Errors}
875 ${OrIf} ${out_var} == ""
876 StrCpy ${out_var} ${default_value}
877 ${EndIf}
878!macroend
879
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100880Function .onInit
Restorer51c94b62024-03-24 09:41:18 +0000881!if ${HAVE_MULTI_LANG}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100882 # Select a language (or read from the registry).
883 !insertmacro MUI_LANGDLL_DISPLAY
884!endif
Bram Moolenaarc3fdf7f2017-10-28 18:36:48 +0200885
Christian Brabandt7d603842021-07-24 21:19:42 +0200886 ${If} $INSTDIR == ${DEFAULT_INSTDIR}
887 # Check $VIM
888 ReadEnvStr $3 "VIM"
889 ${If} $3 != ""
890 StrCpy $INSTDIR $3
891 ${EndIf}
892 ${EndIf}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100893
894 call CheckOldVim
895 Pop $3
896 ${If} $3 == ""
897 # No old versions of Vim found. Unselect and hide the section.
898 !insertmacro UnselectSection ${id_section_old_ver}
899 SectionSetInstTypes ${id_section_old_ver} 0
900 SectionSetText ${id_section_old_ver} ""
901 ${Else}
Christian Brabandt7d603842021-07-24 21:19:42 +0200902 ${If} $INSTDIR == ${DEFAULT_INSTDIR}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100903 StrCpy $INSTDIR $3
904 ${EndIf}
905 ${EndIf}
906
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100907 ${If} ${RunningX64}
908 SetRegView 64
909 ${EndIf}
Bram Moolenaarceb56dd2020-07-14 22:24:40 +0200910 # Load the selections from the registry (if any).
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100911 !insertmacro LoadSectionSelection ${id_section_console} "select_console"
912 !insertmacro LoadSectionSelection ${id_section_batch} "select_batch"
913 !insertmacro LoadSectionSelection ${id_section_desktop} "select_desktop"
914 !insertmacro LoadSectionSelection ${id_section_startmenu} "select_startmenu"
915 !insertmacro LoadSectionSelection ${id_section_editwith} "select_editwith"
916 !insertmacro LoadSectionSelection ${id_section_vimrc} "select_vimrc"
917 !insertmacro LoadSectionSelection ${id_section_pluginhome} "select_pluginhome"
918 !insertmacro LoadSectionSelection ${id_section_pluginvim} "select_pluginvim"
Restorer51c94b62024-03-24 09:41:18 +0000919!if ${HAVE_NLS}
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100920 !insertmacro LoadSectionSelection ${id_section_nls} "select_nls"
921!endif
Bram Moolenaarceb56dd2020-07-14 22:24:40 +0200922 # Load the default _vimrc settings from the registry (if any).
923 !insertmacro LoadDefaultVimrc $vim_compat_stat "vim_compat" "all"
924 !insertmacro LoadDefaultVimrc $vim_keymap_stat "vim_keyremap" "default"
925 !insertmacro LoadDefaultVimrc $vim_mouse_stat "vim_mouse" "default"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100926 ${If} ${RunningX64}
927 SetRegView lastused
928 ${EndIf}
929
930 # User variables:
931 # $0 - holds the directory the executables are installed to
932 # $1 - holds the parameters to be passed to install.exe. Starts with OLE
933 # registration (since a non-OLE gvim will not complain, and we want to
934 # always register an OLE gvim).
935 # $2 - holds the names to create batch files for
936 StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
937 StrCpy $1 "-register-OLE"
938 StrCpy $2 "gvim evim gview gvimdiff vimtutor"
Bram Moolenaarc3fdf7f2017-10-28 18:36:48 +0200939FunctionEnd
940
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100941Function .onInstSuccess
942 WriteUninstaller vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe
943FunctionEnd
Bram Moolenaarc3fdf7f2017-10-28 18:36:48 +0200944
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100945Function .onInstFailed
946 MessageBox MB_OK|MB_ICONEXCLAMATION "$(str_msg_install_fail)" /SD IDOK
Bram Moolenaarc3fdf7f2017-10-28 18:36:48 +0200947FunctionEnd
948
949##########################################################
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100950Function SetCustom
951 # Display the _vimrc setting dialog using nsDialogs.
952
953 # Check if a _vimrc should be created
954 ${IfNot} ${SectionIsSelected} ${id_section_vimrc}
955 Abort
956 ${EndIf}
957
958 !insertmacro MUI_HEADER_TEXT \
959 $(str_vimrc_page_title) $(str_vimrc_page_subtitle)
960
961 nsDialogs::Create 1018
962 Pop $vim_dialog
963
964 ${If} $vim_dialog == error
965 Abort
966 ${EndIf}
967
968 ${If} ${RunningX64}
969 SetRegView 64
970 ${EndIf}
971
972 GetFunctionAddress $3 ValidateCustom
973 nsDialogs::OnBack $3
974
975
976 # 1st group - Compatibility
Restorer6dcf59b2024-03-25 15:38:37 +0000977 ${NSD_CreateGroupBox} 0u 0u 296u 44u $(str_msg_compat_title)
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100978 Pop $3
979
Restorer6dcf59b2024-03-25 15:38:37 +0000980 ${NSD_CreateLabel} 16u 14u 269u 10u $(str_msg_compat_desc)
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100981 Pop $3
Restorer6dcf59b2024-03-25 15:38:37 +0000982 ${NSD_CreateDropList} 42u 26u 237u 13u ""
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100983 Pop $vim_nsd_compat
984 ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_vi)
985 ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_vim)
986 ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_defaults)
987 ${NSD_CB_AddString} $vim_nsd_compat $(str_msg_compat_all)
988
Bram Moolenaarceb56dd2020-07-14 22:24:40 +0200989 ${If} $vim_compat_stat == "defaults"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100990 StrCpy $4 2
Bram Moolenaarceb56dd2020-07-14 22:24:40 +0200991 ${ElseIf} $vim_compat_stat == "vim"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100992 StrCpy $4 1
Bram Moolenaarceb56dd2020-07-14 22:24:40 +0200993 ${ElseIf} $vim_compat_stat == "vi"
Bram Moolenaaraf610b82018-12-21 16:22:50 +0100994 StrCpy $4 0
995 ${Else} # default
996 StrCpy $4 3
997 ${EndIf}
998 ${NSD_CB_SetSelectionIndex} $vim_nsd_compat $4
999
1000
1001 # 2nd group - Key remapping
Restorer6dcf59b2024-03-25 15:38:37 +00001002 ${NSD_CreateGroupBox} 0u 48u 296u 44u $(str_msg_keymap_title)
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001003 Pop $3
1004
Restorer6dcf59b2024-03-25 15:38:37 +00001005 ${NSD_CreateLabel} 16u 62u 269u 10u $(str_msg_keymap_desc)
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001006 Pop $3
Restorer6dcf59b2024-03-25 15:38:37 +00001007 ${NSD_CreateDropList} 42u 74u 236u 13u ""
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001008 Pop $vim_nsd_keymap
1009 ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_default)
1010 ${NSD_CB_AddString} $vim_nsd_keymap $(str_msg_keymap_windows)
1011
Bram Moolenaarceb56dd2020-07-14 22:24:40 +02001012 ${If} $vim_keymap_stat == "windows"
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001013 StrCpy $4 1
1014 ${Else} # default
1015 StrCpy $4 0
1016 ${EndIf}
1017 ${NSD_CB_SetSelectionIndex} $vim_nsd_keymap $4
1018
1019
1020 # 3rd group - Mouse behavior
Restorer6dcf59b2024-03-25 15:38:37 +00001021 ${NSD_CreateGroupBox} 0u 95u 296u 44u $(str_msg_mouse_title)
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001022 Pop $3
1023
Restorer6dcf59b2024-03-25 15:38:37 +00001024 ${NSD_CreateLabel} 16u 108u 269u 10u $(str_msg_mouse_desc)
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001025 Pop $3
Restorer6dcf59b2024-03-25 15:38:37 +00001026 ${NSD_CreateDropList} 42u 121u 237u 13u ""
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001027 Pop $vim_nsd_mouse
1028 ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_default)
1029 ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_windows)
1030 ${NSD_CB_AddString} $vim_nsd_mouse $(str_msg_mouse_unix)
1031
Bram Moolenaarceb56dd2020-07-14 22:24:40 +02001032 ${If} $vim_mouse_stat == "xterm"
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001033 StrCpy $4 2
Bram Moolenaarceb56dd2020-07-14 22:24:40 +02001034 ${ElseIf} $vim_mouse_stat == "windows"
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001035 StrCpy $4 1
1036 ${Else} # default
1037 StrCpy $4 0
1038 ${EndIf}
1039 ${NSD_CB_SetSelectionIndex} $vim_nsd_mouse $4
1040
1041 ${If} ${RunningX64}
1042 SetRegView lastused
1043 ${EndIf}
1044
1045 nsDialogs::Show
1046FunctionEnd
1047
1048Function ValidateCustom
1049 ${NSD_CB_GetSelectionIndex} $vim_nsd_compat $3
1050 ${If} $3 = 0
1051 StrCpy $vim_compat_stat "vi"
1052 ${ElseIf} $3 = 1
1053 StrCpy $vim_compat_stat "vim"
1054 ${ElseIf} $3 = 2
1055 StrCpy $vim_compat_stat "defaults"
1056 ${Else}
1057 StrCpy $vim_compat_stat "all"
1058 ${EndIf}
1059
1060 ${NSD_CB_GetSelectionIndex} $vim_nsd_keymap $3
1061 ${If} $3 = 0
1062 StrCpy $vim_keymap_stat "default"
1063 ${Else}
1064 StrCpy $vim_keymap_stat "windows"
1065 ${EndIf}
1066
1067 ${NSD_CB_GetSelectionIndex} $vim_nsd_mouse $3
1068 ${If} $3 = 0
1069 StrCpy $vim_mouse_stat "default"
1070 ${ElseIf} $3 = 1
1071 StrCpy $vim_mouse_stat "windows"
1072 ${Else}
1073 StrCpy $vim_mouse_stat "xterm"
1074 ${EndIf}
1075FunctionEnd
1076
1077##########################################################
1078# Description for Installer Sections
1079
1080!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1081 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_old_ver} $(str_desc_old_ver)
1082 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_exe} $(str_desc_exe)
1083 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_console} $(str_desc_console)
1084 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_batch} $(str_desc_batch)
1085 !insertmacro MUI_DESCRIPTION_TEXT ${id_group_icons} $(str_desc_icons)
1086 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_desktop} $(str_desc_desktop)
1087 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_startmenu} $(str_desc_start_menu)
1088 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_editwith} $(str_desc_edit_with)
1089 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_vimrc} $(str_desc_vim_rc)
1090 !insertmacro MUI_DESCRIPTION_TEXT ${id_group_plugin} $(str_desc_plugin)
1091 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginhome} $(str_desc_plugin_home)
1092 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_pluginvim} $(str_desc_plugin_vim)
Restorer51c94b62024-03-24 09:41:18 +00001093!if ${HAVE_NLS}
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001094 !insertmacro MUI_DESCRIPTION_TEXT ${id_section_nls} $(str_desc_nls)
1095!endif
1096!insertmacro MUI_FUNCTION_DESCRIPTION_END
1097
1098
1099##########################################################
1100# Uninstaller Functions and Sections
1101
1102Function un.onInit
Restorer51c94b62024-03-24 09:41:18 +00001103!if ${HAVE_MULTI_LANG}
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001104 # Get the language from the registry.
1105 !insertmacro MUI_UNGETLANGUAGE
1106!endif
1107FunctionEnd
1108
1109Section "un.$(str_unsection_register)" id_unsection_register
1110 SectionIn RO
1111
Bram Moolenaar071d4272004-06-13 20:20:40 +00001112 # Apparently $INSTDIR is set to the directory where the uninstaller is
RestorerZ2680a072024-03-20 20:15:51 +01001113 # created. Thus the "vim91" directory is included in it.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001114 StrCpy $0 "$INSTDIR"
1115
Bram Moolenaar071d4272004-06-13 20:20:40 +00001116 # delete the context menu entry and batch files
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001117 DetailPrint "$(str_msg_unregistering)"
Bram Moolenaar30e8e732019-09-27 13:08:36 +02001118 nsExec::Exec "$0\uninstall.exe -nsis"
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001119 Pop $3
Bram Moolenaar071d4272004-06-13 20:20:40 +00001120
1121 # We may have been put to the background when uninstall did something.
1122 BringToFront
1123
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001124 # Delete the installer language setting.
1125 DeleteRegKey ${MUI_LANGDLL_REGISTRY_ROOT} ${MUI_LANGDLL_REGISTRY_KEY}
1126SectionEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +00001127
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001128Section "un.$(str_unsection_exe)" id_unsection_exe
1129
1130 StrCpy $0 "$INSTDIR"
1131
1132 # Delete gettext and iconv DLLs
1133 ${If} ${FileExists} "$0\libiconv-2.dll"
1134 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1135 "$0\libiconv-2.dll"
Bram Moolenaar6199d432017-10-14 19:05:44 +02001136 ${EndIf}
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001137 ${If} ${FileExists} "$0\libintl-8.dll"
1138 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1139 "$0\libintl-8.dll"
1140 ${EndIf}
1141 ${If} ${FileExists} "$0\libgcc_s_sjlj-1.dll"
1142 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1143 "$0\libgcc_s_sjlj-1.dll"
1144 ${EndIf}
1145
1146 # Delete other DLLs
1147 Delete /REBOOTOK $0\*.dll
1148
1149 # Delete 64-bit GvimExt
1150 ${If} ${RunningX64}
1151 !define LIBRARY_X64
1152 ${If} ${FileExists} "$0\GvimExt64\gvimext.dll"
1153 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1154 "$0\GvimExt64\gvimext.dll"
1155 ${EndIf}
1156 ${If} ${FileExists} "$0\GvimExt64\libiconv-2.dll"
1157 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1158 "$0\GvimExt64\libiconv-2.dll"
1159 ${EndIf}
1160 ${If} ${FileExists} "$0\GvimExt64\libintl-8.dll"
1161 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1162 "$0\GvimExt64\libintl-8.dll"
1163 ${EndIf}
1164 ${If} ${FileExists} "$0\GvimExt64\libwinpthread-1.dll"
1165 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1166 "$0\GvimExt64\libwinpthread-1.dll"
1167 ${EndIf}
1168 !undef LIBRARY_X64
1169 RMDir /r $0\GvimExt64
1170 ${EndIf}
1171
1172 # Delete 32-bit GvimExt
1173 ${If} ${FileExists} "$0\GvimExt32\gvimext.dll"
1174 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1175 "$0\GvimExt32\gvimext.dll"
1176 ${EndIf}
1177 ${If} ${FileExists} "$0\GvimExt32\libiconv-2.dll"
1178 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1179 "$0\GvimExt32\libiconv-2.dll"
1180 ${EndIf}
1181 ${If} ${FileExists} "$0\GvimExt32\libintl-8.dll"
1182 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1183 "$0\GvimExt32\libintl-8.dll"
1184 ${EndIf}
1185 ${If} ${FileExists} "$0\GvimExt32\libgcc_s_sjlj-1.dll"
1186 !insertmacro UninstallLib DLL NOTSHARED REBOOT_NOTPROTECTED \
1187 "$0\GvimExt32\libgcc_s_sjlj-1.dll"
1188 ${EndIf}
1189 RMDir /r $0\GvimExt32
Bram Moolenaar6199d432017-10-14 19:05:44 +02001190
Bram Moolenaar071d4272004-06-13 20:20:40 +00001191 ClearErrors
1192 # Remove everything but *.dll files. Avoids that
1193 # a lot remains when gvimext.dll cannot be deleted.
Bram Moolenaar408b5852006-05-13 10:44:07 +00001194 RMDir /r $0\autoload
Bram Moolenaar071d4272004-06-13 20:20:40 +00001195 RMDir /r $0\colors
1196 RMDir /r $0\compiler
1197 RMDir /r $0\doc
1198 RMDir /r $0\ftplugin
Bram Moolenaar44433da2022-05-06 18:08:52 +01001199 RMDir /r $0\import
Bram Moolenaar071d4272004-06-13 20:20:40 +00001200 RMDir /r $0\indent
1201 RMDir /r $0\macros
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001202 RMDir /r $0\pack
Bram Moolenaar071d4272004-06-13 20:20:40 +00001203 RMDir /r $0\plugin
Bram Moolenaar408b5852006-05-13 10:44:07 +00001204 RMDir /r $0\spell
Bram Moolenaar071d4272004-06-13 20:20:40 +00001205 RMDir /r $0\syntax
1206 RMDir /r $0\tools
1207 RMDir /r $0\tutor
Bram Moolenaar071d4272004-06-13 20:20:40 +00001208 RMDir /r $0\lang
1209 RMDir /r $0\keymap
RestorerZ2680a072024-03-20 20:15:51 +01001210 RMDir /r $0\bitmaps
Bram Moolenaar071d4272004-06-13 20:20:40 +00001211 Delete $0\*.exe
1212 Delete $0\*.bat
1213 Delete $0\*.vim
1214 Delete $0\*.txt
1215
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001216 ${If} ${Errors}
1217 MessageBox MB_OK|MB_ICONEXCLAMATION $(str_msg_rm_exe_fail) /SD IDOK
1218 ${EndIf}
Bram Moolenaar071d4272004-06-13 20:20:40 +00001219
RestorerZ2680a072024-03-20 20:15:51 +01001220 # No error message if the "vim91" directory can't be removed, the
Bram Moolenaar071d4272004-06-13 20:20:40 +00001221 # gvimext.dll may still be there.
1222 RMDir $0
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001223SectionEnd
Bram Moolenaar071d4272004-06-13 20:20:40 +00001224
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001225# Remove "vimfiles" directory under the specified directory.
1226!macro RemoveVimfiles dir
RestorerZ2680a072024-03-20 20:15:51 +01001227 ${If} ${FileExists} ${dir}\_viminfo
1228 Delete ${dir}\_viminfo
1229 ${EndIf}
1230 ${If} ${DirExists} ${dir}\vimfiles
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001231 RMDir ${dir}\vimfiles\colors
1232 RMDir ${dir}\vimfiles\compiler
1233 RMDir ${dir}\vimfiles\doc
1234 RMDir ${dir}\vimfiles\ftdetect
1235 RMDir ${dir}\vimfiles\ftplugin
1236 RMDir ${dir}\vimfiles\indent
1237 RMDir ${dir}\vimfiles\keymap
1238 RMDir ${dir}\vimfiles\plugin
1239 RMDir ${dir}\vimfiles\syntax
RestorerZ2680a072024-03-20 20:15:51 +01001240 ${If} ${FileExists} ${dir}\vimfiles\.netrwhist*
1241 Delete ${dir}\vimfiles\.netrwhist*
1242 ${EndIf}
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001243 RMDir ${dir}\vimfiles
1244 ${EndIf}
1245!macroend
1246
1247SectionGroup "un.$(str_ungroup_plugin)" id_ungroup_plugin
1248 Section /o "un.$(str_unsection_plugin_home)" id_unsection_plugin_home
1249 # get the home dir
Christopher Plewrighteea0a002023-02-17 20:04:51 +00001250 Call un.GetHomeDir
1251 Pop $0
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001252
1253 ${If} $0 != ""
1254 !insertmacro RemoveVimfiles $0
1255 ${EndIf}
1256 SectionEnd
1257
1258 Section "un.$(str_unsection_plugin_vim)" id_unsection_plugin_vim
1259 # get the parent dir of the installation
1260 Push $INSTDIR
1261 Call un.GetParent
1262 Pop $0
1263
1264 # if a plugin dir was created at installation remove it
1265 !insertmacro RemoveVimfiles $0
1266 SectionEnd
1267SectionGroupEnd
1268
1269Section "un.$(str_unsection_rootdir)" id_unsection_rootdir
Bram Moolenaar071d4272004-06-13 20:20:40 +00001270 # get the parent dir of the installation
1271 Push $INSTDIR
1272 Call un.GetParent
1273 Pop $0
Bram Moolenaar071d4272004-06-13 20:20:40 +00001274
Bram Moolenaara8d22e32019-04-12 21:29:33 +02001275 ${IfNot} ${Silent}
1276 Delete $0\_vimrc
1277 ${Endif}
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001278 RMDir $0
Bram Moolenaar071d4272004-06-13 20:20:40 +00001279SectionEnd
Bram Moolenaaraf610b82018-12-21 16:22:50 +01001280
1281##########################################################
1282# Description for Uninstaller Sections
1283
1284!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
1285 !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_register} $(str_desc_unregister)
1286 !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_exe} $(str_desc_rm_exe)
1287 !insertmacro MUI_DESCRIPTION_TEXT ${id_ungroup_plugin} $(str_desc_rm_plugin)
1288 !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_home} $(str_desc_rm_plugin_home)
1289 !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_plugin_vim} $(str_desc_rm_plugin_vim)
1290 !insertmacro MUI_DESCRIPTION_TEXT ${id_unsection_rootdir} $(str_desc_rm_rootdir)
1291!insertmacro MUI_UNFUNCTION_DESCRIPTION_END