I am trying to provide a COM object that can be used as a replacement for an object in an executable file with which I do not control. I created an implementation of this COM object with all the same interfaces. I want to be able to use this replacement only occasionally, so I don't want its registration to replace the original object.
I can force the executable to load my COM object instead of the original, using the free COM code by changing the manifest of the executable to look in my DLL to find the com object, and not look for the original through the registry.
So far so good. But this requires changing the manifest file in the executable file. I do not want this change to be permanent, and since the executable file is usually installed in the "program files", it will also require administrator rights to modify this file.
Ideally, I would like to leave the original executable unchanged. Then, if necessary, the separate launcher that I created will download the requested executable file using a manifest that redirects to my com object instead of the original manifest file in the executable.
Is something like this possible? Or maybe the best way to do what I'm trying to do?
Note. I probably cannot duplicate the executable file with the manifest changed at the location where I have write access, because I donβt know in advance what all the dependencies of this executable file will be (you may need a dll from the same directory or data files from a subdirectory). I could set the working directory of the modified executable as the directory of the original executable, but if the executable does nothing, it could be broken.
source share