Skip to content

Commit 7d60384

Browse files
chrisbrabrammool
authored andcommitted
patch 8.2.3214: MS-Windows: passing /D does not set the install location
Problem: MS-Windows: passing /D does not set the install location. Solution: Adjust how the installer uses $VIM. Update the documentation. (Christian Brabandt, closes #8605)
1 parent 9c9472f commit 7d60384

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed

nsis/gvim.nsi

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@ RequestExecutionLevel highest
126126
# This adds '\Vim' to the user choice automagically. The actual value is
127127
# obtained below with CheckOldVim.
128128
!ifdef WIN64
129-
InstallDir "$PROGRAMFILES64\Vim"
129+
!define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
130130
!else
131-
InstallDir "$PROGRAMFILES\Vim"
131+
!define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
132132
!endif
133+
InstallDir ${DEFAULT_INSTDIR}
133134

134135
# Types of installs we can perform:
135136
InstType $(str_type_typical)
@@ -710,8 +711,13 @@ Function .onInit
710711
!insertmacro MUI_LANGDLL_DISPLAY
711712
!endif
712713

713-
# Check $VIM
714-
ReadEnvStr $INSTDIR "VIM"
714+
${If} $INSTDIR == ${DEFAULT_INSTDIR}
715+
# Check $VIM
716+
ReadEnvStr $3 "VIM"
717+
${If} $3 != ""
718+
StrCpy $INSTDIR $3
719+
${EndIf}
720+
${EndIf}
715721

716722
call CheckOldVim
717723
Pop $3
@@ -721,20 +727,11 @@ Function .onInit
721727
SectionSetInstTypes ${id_section_old_ver} 0
722728
SectionSetText ${id_section_old_ver} ""
723729
${Else}
724-
${If} $INSTDIR == ""
730+
${If} $INSTDIR == ${DEFAULT_INSTDIR}
725731
StrCpy $INSTDIR $3
726732
${EndIf}
727733
${EndIf}
728734

729-
# If did not find a path: use the default dir.
730-
${If} $INSTDIR == ""
731-
!ifdef WIN64
732-
StrCpy $INSTDIR "$PROGRAMFILES64\Vim"
733-
!else
734-
StrCpy $INSTDIR "$PROGRAMFILES\Vim"
735-
!endif
736-
${EndIf}
737-
738735
${If} ${RunningX64}
739736
SetRegView 64
740737
${EndIf}

runtime/doc/os_win32.txt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ The 32 bit version also runs on 64 bit MS-Windows systems.
1818
4. Using the mouse |win32-mouse|
1919
5. Running under Windows 95 |win32-win95|
2020
6. Running under Windows 3.1 |win32-win3.1|
21-
7. Win32 mini FAQ |win32-faq|
21+
7. Installation package |win32-installer|
22+
8. Win32 mini FAQ |win32-faq|
2223

2324
Additionally, there are a number of common Win32 and DOS items:
2425
File locations |dos-locations|
@@ -175,7 +176,29 @@ There was a special version of gvim that runs under Windows 3.1 and 3.11.
175176
Support was removed in patch 7.4.1364.
176177

177178
==============================================================================
178-
7. Win32 mini FAQ *win32-faq*
179+
7. Installation package *win32-installer*
180+
181+
A simple installer for windows is available at http://www.vim.org/download.php
182+
(stable version) and nightly builds are also available at
183+
https://github.com/vim/vim-win32-installer/releases/
184+
185+
The nightly builds include 32bit and 64bit builds, have most features enabled
186+
and usually also contain an extra cryptographic signed installer, so Windows
187+
will not complain.
188+
189+
To use the installer, simply run the exe file. The following switches are
190+
also supported: >
191+
192+
gvim_<version>.exe /S -> silent install without any dialogues
193+
gvim_<version>.exe /D=C:\vim -> Install into directory c:\vim
194+
-> /D must be the last argument
195+
gvim_<version>.exe /S /D=c:\vim -> silent install into c:\vim
196+
<
197+
The default installation directory can alternatively be given by setting the
198+
$VIM environment variable.
199+
200+
==============================================================================
201+
8. Win32 mini FAQ *win32-faq*
179202

180203
Q. How do I change the font?
181204
A. In the GUI version, you can use the 'guifont' option. Example: >

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3214,
758760
/**/
759761
3213,
760762
/**/

0 commit comments

Comments
 (0)