setup.exe CoCreateInstance error.

Corinna Vinschen
Wed Jul 1 11:28:00 GMT 2009

Hi Dave,

On Jul  1 09:42, Dave Korn wrote:
>     Hi Corinna,
>   I got this warning dialog during testing (w2k), after I updated to HEAD:
> ---------------------------
> make_link_2
> ---------------------------
> CoCreateInstance failed with error 80004002.
> Setup will not be able to create Cygwin Icons
> in the Start Menu or on the Desktop.
> ---------------------------
> OK
> ---------------------------
>   That's E_NOINTERFACE.  I checked the value of CLSID_ShellLink in the w32api
> sources, and made sure that I appear to have the required registry key:
> HKEY_CLASSES_ROOT\CLSID\{00021401-0000-0000-C000-000000000046}
>   So it looks as if there may not even be any one place to call
> CoCreateInstance from that works for both win7 and w2k.  Argh.  I had a quick
> hack at it by trying to call CoCreateInstance again in make_link_2 if the 'sl'
> pointer wasn't already set but it still failed (same error); maybe w2k just
> isn't happy with having CoInit called so early.  I'm going to leave it for now
> because I want to get on with the libstdcxx support respin, but I could do
> some testing if you can think up a patch.

This is really a problem.  I can't reproduce this on my W2K test
machine.  It works fine for me there.  When I implemented this I tested
it on W2K, XP, Vista, and W7.

Can you add debug code which checks the return code of the
CoInitializeEx call in line 164?  Maybe that's already going
wrong.  However, I don't know what to do besides of calling the
functions in different places depending on the OS.  That really doesn't
make sense.  I wish Microsoft had implemented a simple C function to
create shortcuts, rather than providing only this COM nonsense.

Oh well, given that W7 is not yet RTMed, maybe the problem still goes
away and the patch can be reverted.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-apps mailing list