Package Standalone Application with Application Compiler App

To compile MATLAB® code into a standalone application:

  1. Open the Application Compiler.

    1. On the toolstrip select the Apps tab.

    2. Click the arrow at the far right of the tab to open the apps gallery.

    3. Click Application Compiler to open the MATLAB Compiler project window.

      Note

      To open an existing project, select it from the MATLAB Current Folder panel.

      Note

      You can also launch the standalone compiler using the applicationCompiler function.

  2. Specify the main file of the MATLAB application you want to deploy.

    1. In the Main File section of the toolstrip, click the plus button.

      Note

      If the Main File section of the toolstrip is collapsed, you can expand it by clicking the down arrow.

    2. In the file explorer that opens, locate and select the MATLAB file.

    3. Click Open to select the file and close the file explorer.

      The selected file’s name is added to the list of main files and the plus button will be replaced by a minus button. The file name is used as the default application name.

  3. In the Packaging Options section of the toolstrip, specify how the installer will deliver the MATLAB Runtime with the application.

    Note

    If the Packaging Options section of the toolstrip is collapsed, you can expand it by clicking the down arrow.

    You can select one or both of the following options:

    • Runtime downloaded from web — Generates an installer that downloads the MATLAB Runtime installer from the Web.

    • Runtime included in package — Generates an installer that includes the MATLAB Runtime installer.

    Note

    Selecting both options creates two installers.

    Regardless of what options are selected the generated installer scans the target system to determine if there is an existing installation of the appropriate MATLAB Runtime. If there is not, the installer installs the MATLAB Runtime.

  4. Specify the name of any generated installers.

  5. In the Application Information and Additional Installer Options sections of the compiler, customize the look and feel of the generated installer.

    You can change the information used to identify the application data used by the installer:

    • Splash screen

      Note

      On Windows, the splash screen will be displayed when the compiled application starts in addition to when the installer runs.

    • Application icon

    • Application version

    • Name and contact information of the application’s author

    • Brief summary of the application’s purpose

    • Detailed description of the application

    You can also change the default location into which the application is installed and provide some notes to the installer.

    All of the provided information is displayed as the installer runs.

    For more information see Customize the Installer.

  6. In the Files required for your application to run section of the compiler, verify that all of the files required to run the MATLAB application are listed.

    Note

    These files are compiled into the generated binaries along with the main file.

    Note

    For Standalone Applications with MapReduce, you can find the map function and the reduce function in the current directory. If the map function and the reduce function are not available in current directory, you must include them in the MATLAB search path.

    In general the built-in dependency checker automatically populates this section with the appropriate files. However, you can manually add any files it missed.

    For more information see Manage Required Files in Compiler Project.

  7. In the Files installed for your end user section of the compiler, verify that any additional non-MATLAB files you want installed with the application are listed.

    Note

    These files are placed in the applications folder of the installed application.

    This section automatically lists:

    • Generated executable

    • (Linux®) Shell script for launching the application

    • Readme file

    You can manually add files to the list. Additional files can include documentation, sample data files, and examples to accompany the application.

    For more information see Specify Files to Install with Application.

  8. In the Additional Runtime Settings section of the compiler, specify some of the advanced runtime behaviors for the application.

    These behaviors include:

    • (Windows®) if a command window is required to run the application

    • if the application generates a log file

    For more information see Customize Application Runtime Settings.

  9. Click Settings to customize the flags passed to the compiler and the folders where the generated files are written.

  10. Click Package to compile the MATLAB code and generate the installers.

  11. Verify the contents of the generated output:

    • for_redistribution folder contains the file that installs the application and the MATLAB Runtime.

    • for_testing folder contains all the artifacts created by mcc like binaries and jar, header, and source files for a specific target. Use these files to test the installation.

    • for_redistribution_files_only folder contains the files required for redistribute of the application. Distribute these files to users that have MATLAB or MATLAB Runtime installed on their machines.

    • PackagingLog.txt is a log file generated by the compiler.

Was this topic helpful?