DLL/COM redirection with .exe.local only half-working
Posted on 2006-11-30
We have a windows application, x.exe, which uses a third-party OCX, y.ocx. We install x.exe and y.ocx in the same directory and we register y.ocx (because it can be used by other components outside of x.exe's directory). I'd like to use an x.exe.local file to ensure that the local version of y.ocx is always used by x.exe, even when multiple versions of the application are installed.
If I install two versions of the applications into directories One and Two, with no .local files, I can verify with File Monitor that running One/x.exe after installing Two will pick up Two/y.ocx. As I understand it, creating One/x.exe.local ought to make One/x.exe load One/y.ocx, but it doesn't. Using File Monitor I can see that running One/x.exe now checks that One/y.ocx exists (which wasn't happening before I created the .local file) but then loads Two/y.ocx. x.exe is an MFC application developed with VC6. Where am I going wrong?
(I need a solution for Win2000 as well as XP. I can use a .manifest on XP and it all works. The problems I'm having with .local happen on both XP and on 2000, and I need a solution for 2000.)
(Registering y.ocx by writing just the filename rather than the full pathname into the registry makes it work, but I have to put the full pathname in because y.ocx can be used by other components outside of x.exe's directory.)