MATLAB: How to install the MATLAB Component Runtime without Administrator rights when using MATLAB Compiler 4.6 (R2007a)

MATLAB Compiler

I would like to install the MCR without Administrator rights.

Best Answer

Full installation of the MCR requires administrator rights. However, the features needed for many applications can be installed manually without administrator rights.
This procedure assumes you have the Visual Studio 2005 runtime libraries installed. These are required if you used MATLAB Compiler 4.6 (R2007a) or higher, or if you built your application using Microsoft Visual Studio 2005 or later. Administrator privileges are required to install these libraries; if the compiled application is the first Visual Studio 2005-compiled application on your deployment machine, you may need to install these first. You can find more information on this topic in the Related Solutions below.
This approach works for Compiler standalone applications (EXE-files on Windows), Compiler C and C++ shared libraries (DLL-files on Windows), Builder for .NET COM Objects, and Java Builder components.
It is not sufficient for .NET Assemblies or Builder for Excel COM Objects; you must have Administrator privileges to install the required libraries for these targets.
1. Generate an uncompressed version of the MCR. There are two methods for this:
1.1. If you have Administrator rights on any Windows machine, such as your development machine: Execute MCRInstaller.exe to
install the MATLAB Component Runtime (MCR).
1.2. If you do not: Use BUILDMCR to create MCRInstaller.zip, then expand it:
buildmcr('.')
unzip MCRInstaller.zip
2. Copy the entire MCR directory tree (the directory
where MCR is installed) to the deployment machine.
3. Copy the compiled application into a separate directory on the deployment machine.
4. Add the directory
$MCRROOT\$VER\runtime\$ARCH
to the system environment variable PATH, where $MCRROOT is the location of the copied MCR, $VER is the version (such as "v76"), and $ARCH is the system architecture (such as "win32" or "win64"). This can be done from a Windows Command Prompt:
set PATH=$MCRROOT\$VER\runtime\$ARCH;%PATH%
myApplication.exe
If typed manually, this must be done in each Command Prompt where you launch your application.
4.1. If you have access to the system environment variables through the System Control Panel, you can also modify the path permanently there.
4.2. You can create a BAT-file that executes the above commands, and use that to execute your program.