Why do I receive a "The file is not a valid MATLAB Runtime installer for this version of MATLAB" error when trying to create a MATLAB Compiler installer with integrated MATLAB Runtime?

70 views (last 30 days)
I want to compile my MATLAB code into a standalone installer with "Runtime included in package". I already downloaded the MATLAB Runtime through my web browser so I then choose to specify the location of the already downloaded runtime. If I then refer to my downloaded installer in the MATLAB Preferences, however, a dialog is shown with the following message:
ERROR: The file is not a valid MATLAB Runtime installer for this version of MATLAB.
I am quite sure though I downloaded the runtime for the correct MATLAB release.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Dec 2023
Edited: MathWorks Support Team on 10 Oct 2023

What This Issue Means:

This error may indicate that there is a mismatch in Update levels. For example, you are running MATLAB R2022a Update 2 but you are referencing MATLAB Runtime R2022a Update 3 in the MATLAB Compiler settings.
You can use the following command to verify the exact update level of your MATLAB installation:
>> version
Note that when you download the MATLAB Runtime from the website, you always get the latest Update of the release you choose. If your MATLAB installation is not up-to-date, this could cause the error message shown above.
While it is possible to run applications with a MATLAB Runtime update level that is newer than the MATLAB release used to build the application, we do specifically want to include the MATLAB Runtime version which exactly matches the MATLAB Release and Update when creating "Runtime included in package" installers.
 

Try This Workaround:

To download the exact correct MATLAB Runtime version for your MATLAB installation, either use:
>> compiler.runtime.download
in that specific MATLAB installation, to actually let MATLAB download the installer for you.
In case the download fails, starting in R2020a, the error message will show you the URL to download the MATLAB Runtime directly from our server. Or, can you can run:
>> com.mathworks.toolbox.compiler.MatlabRuntimeUtils.getMCRInstallerDownloadURL()
to obtain an URL which you can then open in a web browser to download the correct version.
After you manually download the installer and copy it onto their machine, you also need to set the MATLAB Runtime Installer preference to point to this installer. You do NOT need to run the installer. You just need to point the preference to the installer.zip that you downloaded. 
 

See also:

More Answers (0)

Categories

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

Tags

No tags entered yet.

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!