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)?
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).