Determine if matlab runtime is installed(preferably using Java)

孤街浪徒 提交于 2019-12-12 18:07:36

问题


I have a Java application that at some point calls on a Matlab executable. For now I just tell the user to install the included runtime manually but I would like to avoid it.

What I'm looking for is a way of determining what version of Matlab runtime(if any) is installed and in case the required version is not installed I'll prompt the user with an option of running the installer.

How can I check for Matlab runtime(preferably using Java)?


回答1:


I think you're talking about running compiled matlab code, right ?

For recent Matlab Runtime releases, you can look in the registry for following key:

HKEY_LOCAL_MACHINE\SOFTWARE\MathWorks\MATLAB Runtime\9.0

Depending on runtime the path may change, for instance for version 8.2 it is:

HKEY_LOCAL_MACHINE\SOFTWARE\MathWorks\MATLAB Compiler Runtime\8.2

Look into HKEY_LOCAL_MACHINE\SOFTWARE\MathWorks and adapt to the version you have.

NB1: Old version of the runtime do not have entry in the registry (for instance version 7.4 (R2006a) doesn't have entry.

NB2: Carefull for path virtualization to 'Wow6432Node' if running in x32 mode on a x64 machine (path virutalization it is normally handle by the system anyway, so it should be no problem).



来源:https://stackoverflow.com/questions/34784624/determine-if-matlab-runtime-is-installedpreferably-using-java

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