How can I create an Application Installer for my MATLAB Compiler standalone application from the command line?

27 views (last 30 days)
How can I create an application installer for my MATLAB Compiler standalone application from the command line?
I checked the options for the 'mcc' command but couldn't find an equivalent to the "Runtime downloaded from web" or "Runtime included in package" options available in application deployment GUIs like the Application Compiler.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 1 Sep 2024
Edited: MathWorks Support Team on 1 Sep 2024

For R2020a and later releases:

Since MATLAB R2020a, you can create an application installer for the files generated by MATLAB Compiler with the 'compiler.package.installer' function:
There are two approaches to using 'compiler.package.installer':
OPTION 1: Use compiler.package.installer with compiler.build functions (R2020b+)
The recommended approach is to use 'compiler.package.installer' together with the new 'compiler.build' functions (available in R2020b and later). The full workflow is documented on the following page:
To include the MATLAB Runtime in the package, run the 'compiler.package.installer' command with the 'RuntimeDelivery' name-value pair set to 'installer'. See an example as follows:
>> buildResults = compiler.build.standaloneApplication(appFile); >> compiler.package.installer(buildResults, 'RuntimeDelivery', 'installer');
To download MATLAB Runtime from the web, run the 'compiler.package.installer' command with the 'RuntimeDelivery' name-value pair set to 'web'. See an example as follows:
>> buildResults = compiler.build.standaloneApplication(appFile); >> compiler.package.installer(buildResults, 'RuntimeDelivery', 'web');
.
OPTION 2: Use compiler.package.installer with mcc (R2020a+)
Creating an application installer for files generated by the 'mcc' command requires a different syntax. Instead of passing a buildResults object, you need to point 'compiler.package.installer' to the locations of generated files. Refer to the examples in the 'compiler.package.installer' documentation for guidance.
When migrating your existing application deployment project (.prj), if you still have access to the "PackagingLog.html" file, you can see the "mcc" command used by the deployment app to create the application at the top of that file.
 

For R2019b and prior releases:

In R2019b and prior, there is a 'deploytool' command-line tool in addition to the application deployment GUIs. Use the "-package" option to create an installer for an existing application deployment project (.prj) without the need to open the GUI:
deploytool -package myproject.prj
For more information, access the 'deploytool' documentation from MATLAB R2019b and prior:
>> doc deploytool

More Answers (0)

Categories

Find more on Get Started with MATLAB Compiler in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!