some issues with the matlab runtime

I have an app that runs smoothly when run through the app designer or compiled to a matlab app. I am now trying to turn it into a standalone desktop app, and a few issues and questions came up.
  1. I have a runtime installer that was downloaded two months ago. howver matlab cannot find it, neither automatically in the aplication compiler nor when I type "mcrinstaller". I tried to give the location of the zip file but got the message "The file is not a valid runtime installer for this version of matlab". both the installer and my matlab are 2020b. do I have to download the installer every time I want to package my app?
  2. The compiled app doesn't work. i tried to ask about it here but didn't get an answer. I now suspect it has something to do with path clashes between matlab and matlab runtime. in the page about matlab runtime under "Install MATLAB and MATLAB Runtime on Same Machine" they wrote "If you install MATLAB Runtime on a machine that already has MATLAB on it, you must adjust the system library path according to your needs". what does this mean? is the system path the matlab path? what does "according to your needs" mean?
  3. following 2- will all users of my app who have matlab on their computer have to adjust their paths as well?
thanks in advance to anyone brave enough to read this long question
Nathan

 Respuesta aceptada

Image Analyst
Image Analyst el 13 de Sept. de 2021

0 votos

You don't give the location of the zip file. You download and install the MCR and you should have a folder (if using Windows) like C:\Program Files\MATLAB\runtime\r2020b. What folders do you have under C:\Program Files\MATLAB on your computer where it does not run?
What is the name of your program and what folder did you install in to?
I use Gammadyne Centurion Setup as my installation package builder. It's far, far superior to MATLAB's deploytool. No contest.
You do not have to download the installer every time you want to run your program or change it. You just need to do it once and it should continue to work. You'll only have to download and install a new release if you compiled your program in the new release.
You do not need to install the runtime library on your development computer. I don't have it installed and I can install and run the deployable standalone program just fine on my computer.
End users will have to install the MCR for the same release you compiled in. The installation process should adjust any paths automatically - they don't need to do anything manually. On rare occasions I've seen them need to reboot but usually they don't.
Don't double click on the icon if you have trouble because the console window will vanish. Get a console window and change directory there and then type the name of your program. Any error messages should remain as long as you compiled with the -m option instead of the -e option of mcc.
See the FAQ:

8 comentarios

Nathan Blanc
Nathan Blanc el 14 de Sept. de 2021
thank you for your answer image analyst.
your instructions were helpful, although MATLAB's app designer instalation packager is very simple and straight-forward so I didn't try "gammadyne centurion".
the key issue that you missed here and fixed the proble for me is that end users have to uninstall previous installations of the MATALB runtime (even if they are of the same version), otherwise path issues might arrise.
Image Analyst
Image Analyst el 14 de Sept. de 2021
Nathan, it's never been a problem for me. I have end users with several of my programs installed, each with a different release. So, they have multiple MCR releases, and multiple "my" programs, on the same computer. Every program seems to know where to go to get the runtime release it needs.
I also have situations where I compile a new version of a single "my" program with the latest release and deploy it. So the user installs the latest MCR and my latest program. So the user has multiple MCRs and a single "my" program. It works fine.
I usually uninstall old MCR's that I know are not needed since they take up a huge amount of disk space. I know which MCR is used because when I compile the program, I create a text file with the name of the MCR I compiled with. See attachments. My compile.m script calls MakeRequiredMATLABReleaseFile() before it calls mcc. So I know instantly when looking at the files in my source code folder what it was compiled with just be seeing that file. Of course I also deploy that file so the end user will also know what MCR was used without having to run the executable.
Nathan Blanc
Nathan Blanc el 15 de Sept. de 2021
thank you again for your answer.
I am not sure why but this indeed fixed the issue for me.
maybe it's a specific bug that has to do with the compilation of the app designer, rather than compiling through the code.
nathan
Muhammad
Muhammad el 24 de Sept. de 2022
Dear Nathan,
I am having similar issue (https://www.mathworks.com/matlabcentral/answers/1807715-app-works-fine-in-matlab-but-fails-to-work-after-deployment), so what fixed it exactly? I am doing this on development computer.
Nathan Blanc
Nathan Blanc el 24 de Sept. de 2022
Hi Muhammad, the key issue that fixed the problem for me is that end users have to uninstall previous installations of the MATALB runtime (even if they are of the same version), otherwise path issues might arrise.
Image Analyst
Image Analyst el 24 de Sept. de 2022
@nathan blanc that should not be the problem. You can check the PATH environment variable. The latest runtime should come first in the list of folders in PATH, but I doubt that would even make a difference because I have old and new programs on the same computer and they run fine. Nonetheless, if that is the only program the end users have they should uninstall the old runtime library because they'll never use it and it takes up gigabytes of disk space.
Muhammad
Muhammad el 25 de Sept. de 2022
Editada: Image Analyst el 25 de Sept. de 2022
@Image Analyst Can you guide me to what is the error for my app? Works fine in matlab, errors out in standalone. All ticks during packaging, packaging log also seems fine. I am doing all this on development computer. Just one runtime, visible in system - wide PATH environment variable. I fail to pinpoint why it isn't working?
Image Analyst
Image Analyst el 25 de Sept. de 2022
No, sorry. You tagged it with "Simulink" and I don't have Simulink. All I can suggest is to see the FAQ:
or call tech support.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Productos

Versión

R2020b

Preguntada:

el 13 de Sept. de 2021

Comentada:

el 25 de Sept. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by