Friday, December 13, 2013

Re: OutlookVim starts the wrong gvim

On 2013-12-13, Gary Johnson wrote:
> On 2013-12-13, Tony Mechelynck wrote:
> > On 13/12/13 06:11, Gary Johnson wrote:
> > >My PC at work was recently upgraded from Windows XP to Windows 7. I
> > >installed Vim 7.3 on it and installed the OutlookVim macro into
> > >Outlook. So far so good. A while later, I installed Vim 7.4 when
> > >it became available at the Vim Without Cream site. This continued
> > >to work fine as long as a gvim instance was already running, which
> > >happened to always be the case.
> > >
> > >Today I tried using OutlookVim from Outlook without any other gvim
> > >running and it opened gvim 7.3 instead of 7.4. I can't figure out
> > >how to get it to open gvim 7.4.
> > >
> > >* Neither Vim installation is in my PATH.
> > >
> > >* I opened Control Panel -> Default Programs -> "Associate a file
> > > type or protocol with a program" and found three extensions
> > > associated with Vim: .log, .txt and .vmb. For each of those, I
> > > set .../vim74/gvim.exe as the default application.
> > >
> > >* I searched the OutlookVim plugin files and did not see a specific
> > > version of gvim specified anywhere.
> > >
> > >* I reinstalled the OutlookVim macro into Outlook.
> > >
> > >None of that worked.
> > >
> > >Does anyone know how I can get OutlookVim to start gvim v.4 instead
> > >of gvim 7.3?
> > >
> > >Thanks,
> > >Gary
> > >
> >
> > I don't know OutlookVim but there ought to be an answer.
> >
> > Did you check if there were any register entries (in either
> > HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER) associated with OutlookVim?
>
> Checked. There are no matches anywhere in the registry.
>
> I also searched the registry for "vim73" and found a few references,
> but they were all on obscure paths with meaningless (to me) names.
>
> > Or any OutlookVim preferences?
>
> Checked. None that I have set nor the default values contain "73"
> or "74".
>
> > Or even hard or soft links, or whatever Windows names them,
> > pointing from within reach of OutlookVim to the Vim binary?
>
> I opened a Command Prompt and executed "gvim", thinking that perhaps
> I had inadvertently installed the Vim batch files, but it said no
> command found.
>
> > If you find something pointing to Vim 7.3, change it to 7.4 (if
> > you can, of course, since it's "at work").
>
> I can. I hesitate to change any of those obscure registry entries,
> though, not knowing what they're for.
>
> > Otherwise, if nothing else avails, you could
> > (a) always start Vim (if not already running) together with Outlook; or
> > (b) arrange (I'm not sure how but I know it is possible) that
> > invoking Vim 7.3 would always launch your latest 7.4. (This could be
> > seen as "cheating", and would make Vim 7.3 unavailable.)
>
> I have thought about uninstalling Vim 7.3, or renaming
> ...\vim73\gvim.exe to force a failure to launch OutlookVim and
> hopefully to bring up a dialog asking me what program I want to use.
> The main reason I keep Vim 7.3 around is to avoid breaking any
> Windows applications or associations that I haven't yet changed to
> use Vim 7.4. This is the first one that I haven't been able to
> change.
>
> As long as I was thinking about it, I decided to try renaming
> ...\vim73\gvim.exe. I then tried to use OutlookVim by clicking on
> the Vim.Edit button in a reply. The result was not the dialog I was
> hoping for but one with simply an error message:
>
> Microsoft Outlook
> -----------------
> OutlookVim: Could not create a Vim OLE object, please ensure Vim has
> been installed.
> Inside Vim, the command[:echo has('ole')] should echo 1
>
> I'll try to find that message within the OutlookVim plugin the next
> time I have a few moments free.

I found it!

That message came from the OutlookVim.bas file after this line was
executed,

Set Vim = CreateObject("Vim.Application")

and set Vim to Nothing. I searched the registry for any keys
containing "vim" and found two that looked promising:

Computer\HKEY_CLASSES_ROOT\Vim.Application
Computer\HKEY_CLASSES_ROOT\Vim.Application.1

Neither of them contained any values pointing to gvim, but they
_did_ contain CLSID keys with the same value,

{0F0BFAE1-4C90-11D1-82D7-0004AC368519}

I then searched the registry for that string and found it as a key
in three places:

Computer\HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0F0BFAE1-4C90-11D1-82D7-0004AC368519}
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{0F0BFAE1-4C90-11D1-82D7-0004AC368519}
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{0F0BFAE1-4C90-11D1-82D7-0004AC368519}

All contained keys named LocalServer32 and having the value

C:\Program Files (x86)\vim\vim73\gvim.exe

I had found those entries before, but they were the obscure keys I
mentioned previously and whose names had scared me from changing
them.

They must all be aliases to the same location because changing the
first one from "vim73" to "vim74" automatically changed the other
two.

That fixed it.

My guess is that the installer for Vim 7.4 did not correctly
register Vim with OLE, but I don't know anything about the installer
or OLE registration.

Regards,
Gary

--
--
You received this message from the "vim_use" 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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment