Bug: Vim NSIS installer ignores the /D option for the target directory

264 views
Skip to first unread message

Tim Lebedkov

unread,
Sep 13, 2014, 9:50:40 AM9/13/14
to vim...@googlegroups.com
Hello,

the following command does not work as expected and installs Vim in C:\Program Files (x86)\vim\vim74:

"%setup%" /S /D=%CD%

--

Andrei Olsen

unread,
Sep 13, 2014, 11:13:38 PM9/13/14
to vim...@googlegroups.com

/D= sets $InstDir before .onInit script code is called, so it doesn't work because script code overrides the $InstDir on line 108 in gvim.nsis.

Andrei Olsen

unread,
Sep 14, 2014, 12:55:26 AM9/14/14
to vim...@googlegroups.com

Line 103, but the point is still the same.

KF Leong

unread,
Sep 14, 2014, 5:33:26 AM9/14/14
to vim...@googlegroups.com

Isn't it a high time to revisit the old thread of NSIS installer using MUI2?
https://groups.google.com/forum/#!searchin/vim_dev/nsis$20mui2/vim_dev/8PektlxWJvQ/68k4_pWT5QMJ

I have been using it for quite a while (with minor updates for Vim 7.4++) and it works quite nice.

KF

Leonardo Valeri Manera

unread,
Sep 14, 2014, 5:52:47 AM9/14/14
to vim_dev
On 14 September 2014 11:33, KF Leong <kfleo...@gmail.com> wrote:
> Isn't it a high time to revisit the old thread of NSIS installer using MUI2?
> https://groups.google.com/forum/#!searchin/vim_dev/nsis$20mui2/vim_dev/8PektlxWJvQ/68k4_pWT5QMJ
>
> I have been using it for quite a while (with minor updates for Vim 7.4++) and it works quite nice.
>
> KF
>
> --

Same here.

The installer script in vim master is mostly fine, but I never
understood why it was not updated to the MUI2 installer ... seems to
be better all-around.

Bram Moolenaar

unread,
Sep 14, 2014, 7:46:00 AM9/14/14
to Leonardo Valeri Manera, vim_dev

Leonardo Valeri Manera wrote:

> On 14 September 2014 11:33, KF Leong <kfleo...@gmail.com> wrote:
> > Isn't it a high time to revisit the old thread of NSIS installer using MUI2?
> > https://groups.google.com/forum/#!searchin/vim_dev/nsis$20mui2/vim_dev/8PektlxWJvQ/68k4_pWT5QMJ
> >
> > I have been using it for quite a while (with minor updates for Vim
> > 7.4++) and it works quite nice.
>
> Same here.
>
> The installer script in vim master is mostly fine, but I never
> understood why it was not updated to the MUI2 installer ... seems to
> be better all-around.

This requires someone to spend time on it, trying it out on various
systems and with various configurations. Just "works for me" is not
enough.

There was also an alternative that didn't use the DOS programs. Since
DOS is now completely outdated (Anyone running Windows 95?) we could
drop that, but we have to make sure all details of the installation are
correct.

--
hundred-and-one symptoms of being an internet addict:
131. You challenge authority and society by portnuking people

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

KF Leong

unread,
Sep 14, 2014, 10:07:56 AM9/14/14
to vim...@googlegroups.com, l.valer...@gmail.com
On Sunday, September 14, 2014 7:46:00 PM UTC+8, Bram Moolenaar wrote:
> Leonardo Valeri Manera wrote:
>
>
>
> > On 14 September 2014 11:33, KF Leong <x...@gmail.com> wrote:
>
> > > Isn't it a high time to revisit the old thread of NSIS installer using MUI2?
>
> > > https://groups.google.com/forum/#!searchin/vim_dev/nsis$20mui2/vim_dev/8PektlxWJvQ/68k4_pWT5QMJ
>
> > >
>
> > > I have been using it for quite a while (with minor updates for Vim
>
> > > 7.4++) and it works quite nice.
>
> >
>
> > Same here.
>
> >
>
> > The installer script in vim master is mostly fine, but I never
>
> > understood why it was not updated to the MUI2 installer ... seems to
>
> > be better all-around.
>
>
>
> This requires someone to spend time on it, trying it out on various
>
> systems and with various configurations. Just "works for me" is not
>
> enough.
>
>
>
> There was also an alternative that didn't use the DOS programs. Since
>
> DOS is now completely outdated (Anyone running Windows 95?) we could
>
> drop that, but we have to make sure all details of the installation are
>
> correct.
>

I have an installer utilizing the MUI2 script in the thread that people can try out. (I am not familiar with NSIS, but able to "hack" together to make it work...)
https://dl.dropboxusercontent.com/u/21119576/%5B_Utils_%5D/gvim74-442.exe

I have tested it on few PCs with Windows 7 x86/x64 and Windows 8.1u1 x86/x64.

KF

Tim Lebedkov

unread,
Sep 15, 2014, 4:37:43 PM9/15/14
to vim...@googlegroups.com, l.valer...@gmail.com
The installer works also on Windows 2008 R2 Datacenter, but the silent
installation does not work at all (neither /S nor /D)
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/crx2KRMer8k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

KF Leong

unread,
Sep 17, 2014, 9:36:52 AM9/17/14
to vim...@googlegroups.com, l.valer...@gmail.com
On Tuesday, September 16, 2014 4:37:43 AM UTC+8, Tim Lebedkov wrote:
> The installer works also on Windows 2008 R2 Datacenter, but the silent
>
> installation does not work at all (neither /S nor /D)
>
>
Hmm... tests using /S /D:C:\vim parameters does not work.
Works with /S /D:D:\vim...
It seems Windows needs to have elevated privilege to install on C:\ drive.

Not sure how to go about it!

KF

Andrei Olsen

unread,
Sep 17, 2014, 9:52:31 AM9/17/14
to vim...@googlegroups.com, l.valer...@gmail.com

Shouldn't it be /D= and not /D:?

KF Leong

unread,
Sep 17, 2014, 10:03:04 AM9/17/14
to vim...@googlegroups.com, l.valer...@gmail.com

Yes, it should be /D= ...

Anyway further testing shows that the silent installation works. From non admin command line, it will prompt to elevate privilege before installation starts. While with admin command line, it will directly install without prompt.

This was tested on Windows 8.1u1 x64 system. (original install of Vim was un-install before test)

KF

Tim Lebedkov

unread,
Sep 18, 2014, 4:14:45 PM9/18/14
to vim...@googlegroups.com
unfortunately still does not work for me on Windows 2008 R2 Datacenter
with "/S" or "/S /D". The exit code is 0.

--

Andrei Olsen

unread,
Sep 18, 2014, 8:56:31 PM9/18/14
to vim...@googlegroups.com
On Thursday, September 18, 2014 10:14:45 PM UTC+2, Tim Lebedkov wrote:
> unfortunately still does not work for me on Windows 2008 R2 Datacenter
>
> with "/S" or "/S /D". The exit code is 0.

You could perhaps try this with the original NSIS file: Replace "Function .onInit" line with the following and use /INSTDIR= instead of /D.

!include FileFunc.nsh
!insertmacro GetParameters
!insertmacro GetOptions

Function .onInit
${GetParameters} $R0
ClearErrors
${GetOptions} $R0 "/INSTDIR=" $INSTDIR
IfErrors 0 IniOK

KF Leong

unread,
Sep 19, 2014, 1:27:12 AM9/19/14
to vim...@googlegroups.com

On Friday, September 19, 2014 4:14:45 AM UTC+8, Tim Lebedkov wrote:
> unfortunately still does not work for me on Windows 2008 R2 Datacenter
>
> with "/S" or "/S /D". The exit code is 0.

*Do not top-post! Type your reply below the text you are replying to.*

Can you try option /S with /DD? i.e. "/S /DD" will install to default path.

Second, please locate the vim-install.log file and post the contents? It should be in the temp folder...

For more info on the options:
https://raw.githubusercontent.com/gpwen/vim-installer-mui2/wiki-files/gen/vim73_install_manual.txt

KF

Tim Lebedkov

unread,
Sep 19, 2014, 12:07:46 PM9/19/14
to vim...@googlegroups.com
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/crx2KRMer8k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

OK. Here is the output of

gvim74-442.exe /S /D=C:\testvim5

================ output ===============
2014-09-19 16:04:07 - Start Vim installer log
Command line params: [/S]
SetShellVarContext all
SetRegView 64
Found 0 uninstall key(s):
0 of the above versions do not support silent uninstallation.
Initial install path: [C:\testvim5]
ERROR: Invalid install path: C:\testvim5
About to quit with exit code 5.
2014-09-19 16:04:08 - Close Vim installer log
================ output ===============

but this works and installs Vim in C:\testvim6\vim\vim74\vim.exe:

gvim74-442.exe /S /D=C:\testvim6\vim

KF Leong

unread,
Sep 19, 2014, 1:12:25 PM9/19/14
to vim...@googlegroups.com
>
> OK. Here is the output of
>
> gvim74-442.exe /S /D=C:\testvim5
>
> ================ output ===============
>
> 2014-09-19 16:04:07 - Start Vim installer log
> Command line params: [/S]
> SetShellVarContext all
> SetRegView 64
> Found 0 uninstall key(s):
> 0 of the above versions do not support silent uninstallation.
> Initial install path: [C:\testvim5]
> ERROR: Invalid install path: C:\testvim5
> About to quit with exit code 5.
> 2014-09-19 16:04:08 - Close Vim installer log
> ================ output ===============
>
> but this works and installs Vim in C:\testvim6\vim\vim74\vim.exe:
>
> gvim74-442.exe /S /D=C:\testvim6\vim

Hmm... path handling issue with the install script. I am not good with NSIS scripts, maybe others can chime in?

KF

KF Leong

unread,
Sep 19, 2014, 1:25:56 PM9/19/14
to vim...@googlegroups.com
>
> but this works and installs Vim in C:\testvim6\vim\vim74\vim.exe:
>
> gvim74-442.exe /S /D=C:\testvim6\vim

Test with "/S /D=C:\vim" or "/S /D=D:\vim" works...
The script expects the final path should be \vim !!! ;D

KF

Andrei Olsen

unread,
Sep 19, 2014, 2:03:37 PM9/19/14
to vim...@googlegroups.com

I had a brief at the script just now. Looks like it checks for "vim" at line 710.

Tim Lebedkov

unread,
Sep 21, 2014, 4:23:17 AM9/21/14
to vim...@googlegroups.com
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/crx2KRMer8k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

any news here? Where is your source code? Can we see the changes? Will
you have time to integrate mui2 and fix the /S /D behavior?

KF Leong

unread,
Sep 21, 2014, 5:20:09 AM9/21/14
to vim...@googlegroups.com
> any news here? Where is your source code? Can we see the changes? Will
>
> you have time to integrate mui2 and fix the /S /D behavior?

I am not the original developer of the MUI2 installer. I modified the original source to compile for Vim 7.4, as the original source was for Vim 7.3. The changes are to the version numbers.

Please refer below for the discussion:
https://groups.google.com/forum/#!searchin/vim_dev/nsis$20mui2/vim_dev/8PektlxWJvQ/68k4_pWT5QMJ

As I am not familiar with NSIS scripts (still learning...), maybe other more capable person can chime in and correct the /S /D behaviour?

KF

Tim Lebedkov

unread,
Sep 21, 2014, 12:58:27 PM9/21/14
to vim...@googlegroups.com
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_dev" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_dev/crx2KRMer8k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

would somebody else at least fix the bug with /S /D?

KF Leong

unread,
Sep 22, 2014, 9:44:51 AM9/22/14
to vim...@googlegroups.com
>
> would somebody else at least fix the bug with /S /D?

As a temporary solution, you can use the following to install:
/S /D=C:\test5vim
/S /D=C:\vim
/S /D=C:\vimvim

And it will install Vim in the specified folder (end with vim!)...

KF

Tim Lebedkov

unread,
Sep 23, 2014, 5:22:38 PM9/23/14
to vim...@googlegroups.com
I will try to fix this in the NSIS script

KF Leong

unread,
Nov 6, 2014, 3:26:09 AM11/6/14
to vim...@googlegroups.com
On Wednesday, September 24, 2014 5:22:38 AM UTC+8, Tim Lebedkov wrote:
> I will try to fix this in the NSIS script
>
Tim,

As your changes to the NSIS script is in main line, I have updated my installer with the changes (MUI2 interface, silent install, etc...) Please test.

Here's the link -- 7.4.506:
https://dl.dropboxusercontent.com/u/21119576/%5B_Utils_%5D/gvim74-506.exe

Cheers,
KF

Tim Lebedkov

unread,
Nov 7, 2014, 12:13:00 PM11/7/14
to vim...@googlegroups.com
Hi,

the repository at https://github.com/gpwen/vim-installer-mui2/wiki is interesting, but the changes there do not help as they will probably never be merged.

My next patch will introduce MUI2.

KF Leong

unread,
Nov 7, 2014, 10:43:46 PM11/7/14
to vim...@googlegroups.com
On Saturday, November 8, 2014 1:13:00 AM UTC+8, Tim Lebedkov wrote:
> Hi,
>
> the repository at https://github.com/gpwen/vim-installer-mui2/wiki is interesting, but the changes there do not help as they will probably never be merged.
>
> My next patch will introduce MUI2.
>

What is your opinion about the script from gpwen? Why do you think it will never be merged into mainline?

It would also be nice to have pure 64-bit binaries support on 64-bit OS, in addition to the current 32-bit binaries with 64-bit GVimExt DLL on 64-bit OS.

Regards,
KF

Tim Lebedkov

unread,
Nov 8, 2014, 3:14:41 AM11/8/14
to vim...@googlegroups.com
Am Samstag, 8. November 2014 04:43:46 UTC+1 schrieb KF Leong:
> On Saturday, November 8, 2014 1:13:00 AM UTC+8, Tim Lebedkov wrote:
> > Hi,
> >
> > the repository at https://github.com/gpwen/vim-installer-mui2/wiki is interesting, but the changes there do not help as they will probably never be merged.
> >
> > My next patch will introduce MUI2.
> >
>
> What is your opinion about the script from gpwen? Why do you think it will never be merged into mainline?
>

I think the code there is good, but it wasn't merged in the last 4 years. Why would it ever be merged? Nobody works on the code.


> It would also be nice to have pure 64-bit binaries support on 64-bit OS, in addition to the current 32-bit binaries with 64-bit GVimExt DLL on 64-bit OS.
>

agree

BTW, my MUI2-patch is almost done.

> Regards,
> KF

Reply all
Reply to author
Forward
0 new messages