compiler.r​untime.cus​tomInstall​er fails to reduce mcr installer size

27 views (last 30 days)
I have a matlab toolbox, with a single-window GUI. I was able to build it with mcc/deploytool to create a standalone 7MB executable. However, I was not happy for the installer size, as the R2016 matlab runtime is 700MB in size, 100x larger than my application.
When I saw a new matlab compiler API compiler.runtime.customInstaller coming with R2024b is cable of creating smaller MCR installer including only needed files, I was very happy and immediately tried it, however, the result was disappointing.
The installer bundled with MCR in R2024b for my app build by deploytool - without using the customInstaller - is 1.2GB in size (another 2x increase in size compared to the already large package generated by R2016). Then, when I called
results = compiler.build.standaloneApplication("myapp.m");
compiler.runtime.customInstaller("myapp_installer", results, 'RuntimeDelivery', 'installer');
however, the generated package has the same 1.2GB in size. I have followed the help page of compiler.runtime.customInstaller
I feel that I am missing something - is this the right way to call compiler.runtime.customInstaller?
the requiredMCRProducts.txt file shows that I only need the following MCR components - is 1.2GB the anticipated package size?
  • 'MATLAB Runtime - Core'
  • 'MATLAB Runtime - Graphics'
  • 'MATLAB Runtime - Non Interactive MATLAB'
  • 'MATLAB Runtime - Numerics'
  • 'MATLAB Runtime - Image Processing Toolbox Addin'
  2 Comments
Sumukh
Sumukh on 29 Oct 2024
Can you please provide the "myapp.m" file to reproduce the issue and try to resolve it on my PC?
Qianqian Fang
Qianqian Fang on 29 Oct 2024
sure, my toolbox is open-source - you can download it at https://github.com/fangq/iso2mesh/
you can also use deploytool to open i2m.prj to build the project - I just want to create a more compact mcr installer

Sign in to comment.

Accepted Answer

Sumukh
Sumukh on 30 Oct 2024
Hi Qianqian,
The command “compiler.runtime.customInstaller” creates an installer that installs the MATLAB Runtime components required by the toolbox, and not the complete MATLAB Runtime. The installer has minimal footprint by default as it installs the MATLAB Runtime components from the MathWorks® website during application installation. This is specified by the “RuntimeDelivery” name-value argument that is set to “web” by default. You can refer to the following documentation to know more about this argument:
The installer includes the MATLAB Runtime components within the installer if the “RuntimeDelivery” option is set to “installer”. This increases the size of the installer. The total size of the MCR components specified in the “requiredMCRProducts.txt” file is close to 1.2GB. This can be verified from the installation dialog box when using the “web” installer to install the Runtime components. The size of the MATLAB Runtime components has significantly increased owing to the addition of features release after release since MATLAB R2016a.
You can set the “RuntimeDelivery” option to “web” to have a much smaller installer size (1.9MB). The installer automatically installs the necessary MATLAB Runtime components for the toolbox from the internet wherever the installer is executed.
  1 Comment
Qianqian Fang
Qianqian Fang on 30 Oct 2024
@Sumukh, my goal is to produce a miminally-sized offline installer - web installer is basically shifting the same file size burden to the user side, adding an additional dependency of a fast ethernet. it is not what I wanted.
when reading the documenation of compiler.runtime.customInstaller,I some how has the impression that it can do more than deploytool in terms of trimming the size of the installer - but it appears that the best that both deploytool, and this API, can currently achieve in terms of MCR component reduction is down to the coarse-grained components being listed - there is no further finer-grained file trimming -
I imagine my 7MB exe only needs a subset of the .dll files from the entire 1.2GB package files, but it seems there is no way the current deploy tool can automatically extract those specific files out of the large package.

Sign in to comment.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!