MATLAB: How does MATLAB know what toolboxes are installed

installationlicensetoolbox

The toolboxes get installed underneath `$INSTALL_PATH/toolbox` but there seems to be more at play than just probing a set path on the file system. What goes on in the installer when a new toolbox is installed to an existing MATLAB installation?

Best Answer

I think I figured out my question, though perhaps I just didn't know what to ask. The `ver` command seems to magically know what toolboxes are installed, and when I looked, it was scanning the MATLAB search path to figure out the names and versions of the toolboxes which are installed.
At that point, all I needed to know is how the global MATLAB search path is initialized. The answer seems to be an automatically-generated file located at `$INSTALL_ROOT/toolbox/local/pathdef.m`. It contains a list of hard-coded search paths that I think are only updated at install time.
I'm not sure what the MATLAB installer uses to regenerate this file, so if for some reason you are not depending on the MATLAB installer to do this, you will have to devise some alternate means (unless someone else knows better). Though, I do see in `$INSTALL_ROOT/toolbox/local/path` a bunch of simple *.phl text files which appear to have relative paths to all the installed toolboxes, so perhaps that would be of aid.
Related Question