Main Content

Deploy Components to End Users

Running the Component Installer

The Library Compiler app creates an installer for the generated .NET component. After compilation is complete, you can find this installer in the for_redistribution folder in your project folder. By default, the compiler names the installer MyAppInstaller_web.exe or MyAppInstaller_mcr.exe, depending on which packaging option you chose. Using the Application Information area of the Library Compiler, you can customize the look of the installer.

For example, when an end user double-clicks the component installer, the first screen identifies your component by name and version number.

Installer screen that identifies the component as makesquare 1.0

By clicking Next on each screen, the installer leads you through the installation process. During installation, you can specify the installation folder.

The installer also automatically downloads and installs MATLAB® Runtime if needed.

MATLAB Runtime

MATLAB Runtime is an execution engine made up of the same shared libraries MATLAB uses to enable execution of MATLAB files on systems without an installed version of MATLAB.

MATLAB Runtime is available to download from the web to simplify the distribution of your applications created using the MATLAB Compiler™ or the MATLAB Compiler SDK™. Download the MATLAB Runtime from the MATLAB Runtime product page or use the compiler.runtime.download MATLAB function.

The MATLAB Runtime installer performs the following actions:

  1. Install the MATLAB Runtime.

  2. Install the component assembly in the folder from which the installer is run.

  3. Copy the MWArray assembly to the Global Assembly Cache (GAC).

MATLAB Runtime Prerequisites

  1. The MATLAB Runtime installer requires administrator privileges to run.

  2. The version of MATLAB Runtime that runs your application on the target computer must be the same as the version of MATLAB Compiler or MATLAB Compiler SDK that built the deployed code, at the same update level or newer.

  3. Do not install the MATLAB Runtime in MATLAB installation directories.

  4. The MATLAB Runtime installer requires approximately 2 GB of disk space.

Add the MATLAB Runtime Installer to the Installer

This example shows how to include the MATLAB Runtime in the generated installer using one of the compiler apps. The generated installer contains all files needed to run the standalone application or shared library built with MATLAB Compiler or MATLAB Compiler SDK and properly lays them out on a target system.

  1. On the Packaging Options section of the compiler interface, select one or both of the following options:

    • Runtime downloaded from web — This option builds an installer that downloads the MATLAB Runtime installer from the MathWorks website.

    • Runtime included in package — The option includes the MATLAB Runtime installer in the generated installer.

  2. Click Package.

  3. Distribute the installer to end users.

Install the MATLAB Runtime

For instructions on how to install the MATLAB Runtime on a system, see Install and Configure MATLAB Runtime.

If you are given an installer containing the compiled artifacts, then MATLAB Runtime is installed along with the application or shared library. If you are given just the raw binary files, you must download and run the MATLAB Runtime installer.

Note

On Windows®, paths are set automatically by the installer. If you are running on a platform other than Windows, you must either modify the path on the target machine or use a shell script to launch the compiled application. Setting the paths enables your application executable to find MATLAB Runtime. For more information on setting the path, see Set MATLAB Runtime Path for Deployment.

Where to find the MWArray API

MATLAB Runtime also includes MWArray.dll, which contains an API for exchanging data between your applications and MATLAB Runtime. You can find documentation for this API in the Help folder of the installation.

On target machines where the MATLAB Runtime installer is run, it puts the MWArray assembly in <MATLAB_RUNTIME_INSTALL_DIR>\toolbox\dotnetbuilder\bin\<ARCH>\<FRAMEWORK_VERSION>.

Sample Directory Structure of the MATLAB Runtime Including MWArray.dll