フィルターのクリア

Self contained Matlab Program

6 ビュー (過去 30 日間)
Wolf Blecher
Wolf Blecher 2022 年 10 月 20 日
コメント済み: Wolf Blecher 2022 年 12 月 2 日
I want to deploy an application compiled with the Matlab Compiler. Ideally this application is self contained/portable.
Due to security constraints, I cannot put something to the path, install something on the user system, etc.
Is it possible to pack the Matlab Runtime (or the necessary dlls) into the folder of the application so that I can just copy it to the system of choice and run it from the corresponding folder?

採用された回答

Wolf Blecher
Wolf Blecher 2022 年 12 月 2 日
Here is my workaround:
  • Install the Matlab-Runtime to a system where you have Administrator Rights (which you hopefully do have somewhere)
  • Copy the Matlab-Runtime Folder (e.g. 2022b) to e.g. C:\DevData\MyLocalApp\2022b
  • Copy your compiled exe file (and all the other files you need) to c:\DevData\MyLocalApp\2022b\runtime\win64
  • Write a script file e.g. C:\DevData\MyLocalApp\CallMe.bat which calls your exe (e.g. .\2022b\runtime\win64\myApp.exe) and passes necessary command line arguments on (if any)
Now you can redistribute the complete folder C:\DevData\MyLocalApp to the other system, without installing the matlab runtime, and run your application by calling the CallMe.bat file.
In cases where you don't want to redistribute the complete Matlab Runtime, but only the part that you need for your application, please follow the instructions by Kevin to include the runtime (installer!!!) with your own app installer. Then just copy this smaller runtime instead of the complete one.
  1 件のコメント
Wolf Blecher
Wolf Blecher 2022 年 12 月 2 日
I tried this also with Symlinks instead of the bat file, but that won't do the trick.

サインインしてコメントする。

その他の回答 (1 件)

Kevin Holly
Kevin Holly 2022 年 10 月 20 日
When you package your app, you can select "Runtime included in package".
You can also add other files to the package by clicking the plus sign shown in the screenshot below.
  3 件のコメント
Kevin Holly
Kevin Holly 2022 年 10 月 20 日
編集済み: Kevin Holly 2022 年 10 月 20 日
See page 45 (4-5) in the link below.
You can add files by using -a filepath with mcc (see link below).
Also see page 79 (7-7) in PDF for installing Runtime without Administrator Rights.
Wolf Blecher
Wolf Blecher 2022 年 10 月 20 日
編集済み: Wolf Blecher 2022 年 10 月 22 日
Thank you Kevin for the Links and the Answer.
I am already using the -a option with mcc to add my other files needed and have them copied. So the only thing that is missing, is the matlab runtime. That is where the question comes from, is it possible to put the Matlab Runtime besides my application so that I DON'T need to
  • Install Matlab Runtime with Admin Rights (which seems to be the usual way to go)
  • Add Something to the PATH Environment of the user (which seems to be necessary when Admin Rights are not available)
Instead I want the runtime to be in the same folder as my application - so to have a really portable app.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by