Install MathLink program with arbitrary PATH environment

时间秒杀一切 提交于 2019-11-29 10:56:09

@acl's solution to wrap mEngine.exe in a batch file, and temporarily modify the PATH from there, works correctly:

I used this as the contents of mEngine.bat:

set PATH=c:\path\to\matlab\bin\win32;%PATH%
start mEngine.exe %*
  • *% ensures that all command line arguments are passed on to mEngine.exe
  • start is necessary to prevent the command window from staying open until mEngine.exe terminates

It can be started using Install["mEngine.bat"].

Since all the information that is needed for the kernel to communicate with mEngine.exe is passed by Install[] as command line arguments, all we need to do is launch mEngine.exe with these arguments. It is not necessary for Install[] to know the location of mEngine.exe, the important thing is that the process gets launched with the correct command line arguments, which is ensured by %*.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!