Main Content

Install Deployed Application

After you create an installer for your compiled application, you can install it interactively using a graphical interface or noninteractively using command-line arguments.

Install Application Interactively

Complete the following steps according to your operating system to install the application my_app interactively using MyAppInstaller.

  1. Start the installer.

    PlatformSteps
    Windows®

    Double-click the file MyAppInstaller.exe.

    Linux®

    In the terminal, type:

    sudo -H ./MyAppInstaller.install

    Note

    You may need to allow the root user to access the running X server:

    xhost +SI:localuser:root
    sudo -H ./install
    xhost -SI:localuser:root

    sudo is only required if you install to a directory that you do not have write access to.

    macOS

    In the terminal, type:

    ./MyAppInstaller

    Note

    You may need to enter an administrator username and password after you run ./MyAppInstaller.

  2. If you want to connect to the Internet using a proxy server, click Connection Settings. Enter the proxy server settings in the provided window and click OK. Click Next.

  3. Choose the installation folder for the application. To create a desktop shortcut, check the box labeled Add a shortcut to the desktop. Click Next.

  4. If MATLAB® Runtime is not already installed on your machine, choose the installation folder for the MATLAB Runtime libraries and click Next.

  5. Select Yes to accept the terms of the MATLAB Runtime license agreement and click Next.

  6. Click Install > to begin the installation.

  7. On Linux and macOS platforms, after copying files to your disk, the installer displays the Product Configuration Notes dialog box. This dialog box contains information necessary for setting your path environment variables. Copy the path information from this dialog box, save it to a text file, and then click Next. For information on setting environment variables, see Set MATLAB Runtime Path for Deployment.

  8. Click Finish to exit the installer.

  9. If you accepted the default settings, you can find the installed application in one of the following locations:

    WindowsC:\Program Files\my_app
    macOS/Applications/my_app
    Linux/usr/my_app

Install Application Noninteractively

If you have many installations to perform, you can specify installation arguments as command-line arguments or in an installer control file to save time and prevent errors. When you specify installation arguments, the installer runs as a background task and does not display any dialog boxes.

When running noninteractively, the installer overwrites the installation location.

Caution

On Linux and macOS systems, the installer displays information necessary for setting your environment variables in the Product Configuration Notes dialog box. If you use the installer noninteractively, you must locate your MATLAB Runtime installation directory in order to set the library path after installation. For more information, see Set MATLAB Runtime Path for Deployment.

To install the application in noninteractively:

  1. Run the installer on the command line and specify the option -agreeToLicense yes. If you do not include -agreeToLicense yes as the first option, the installer will not install the application.

    PlatformCommand
    WindowsMyAppInstaller.exe -agreeToLicense yes
    Linux

    sudo ./MyAppInstaller.install -agreeToLicense yes

    Note

    sudo is only required if you install to a directory you do not have write access to.

    macOS./MyAppInstaller -agreeToLicense yes
  2. View a log of the installation.

    On Windows systems, the installer creates a log file named mathworks_username.log, where username is your Windows login name, in the location defined by your TEMP environment variable. You can specify a log file using the -outputFile option.

    On Linux and macOS systems, the installer displays the log information at the command prompt. If you specify a file using the -outputFile option, it also saves the log information to the file.

Customize Noninteractive Installation

When run noninteractively, the installer uses the default values for installation options unless you specify otherwise. Like the MATLAB installer, the application installer accepts a number of command-line options that modify the default installation properties.

To specify options on the command line, separate each option and its value with a space. For example, on Linux:

./MyAppInstaller.install -agreeToLicense yes \
-outputFile myapp_log.txt -applicationFolder ~/Apps/magicsquare

OptionDescriptionComment
-inputFileSpecifies an installer control file that contains your command-line options and values.

Omit the dash before each option and put each option and value pair on a separate line. For example:

agreeToLicense=yes
startMenuShortcut=true

-applicationFolder (since R2024a)

Specifies where the application is installed.

Do not specify this option with the -destinationFolder option.

-runtimeFolder (since R2024a)

Specifies where MATLAB Runtime is installed.

In the destination folder, MATLAB Runtime is installed in a folder named after the corresponding MATLAB release, for example, R2024b.

Do not specify this option with the -destinationFolder option.

-destinationFolder

Specifies where both the application and MATLAB Runtime are installed.

In the destination folder, MATLAB Runtime is installed in a folder named after the corresponding MATLAB release, for example, R2023b.
-outputFileSpecifies where the installation log file is written.

On Windows, the log file is written to the location defined by your TEMP environment variable by default.

On Linux and macOS, log information is displayed at the command prompt. If you specify a file using this option, it saves the log information to the file.

-desktopShortcut true|falseSpecifies whether to create a desktop shortcut icon for the installed application.This option must be specified in an installer control file provided by -inputFile. The default value is false. This option is only used on Windows.
-startMenuShortcut true|falseSpecifies whether to create a Start Menu shortcut icon for the installed application.This option must be specified in an installer control file provided by -inputFile. The default value is false. This option is only used on Windows.

Related Topics