I am working on a MATLAB Engine application. In order for it to work, MATLAB needs to be added to the PATH environment variable so that the Engine application can find certain DLLs (libeng and libmx).
When MATLAB is registered as a COM server, it writes its location into the registry and I can access it. Using this information, is there a simple way to allow the Engine application to work without having to add MATLAB to the PATH? The Engine application could theoretically read the location of these DLLs from the registry, but the problem is that it won't even start up without those DLLs (when compiled the standard way, according to MATLAB Engine compilation instructions).
I am not very familiar with winapi and not at all familiar with COM.
Is there an easy solution to let the problem find its DLLs based on the information from the registry?