How can I know which files are being used by my compiled GUI?

24 ビュー (過去 30 日間)
Mark Golberg
Mark Golberg 2022 年 4 月 28 日
編集済み: Image Analyst 2022 年 5 月 1 日
Hello,
I've created a uitility via App Designer, and compiled an exe version for my colleagues to use it as well.
The utiliy composed of all sorts of files: *.m , *.jpg , *.xml
I'd like to prepare a "distribution" folder with only the necessary files. I mean the main exe file itself + (???)
How this can be done? Obviously if I open the exe and try to do a certain functionality, I may revieve an error if a certain file is missing. So that way I know for sure this file is required to be included in my "distribution folder". BUT, the GUI has a lot of options / functionalities / modes of operation... I don't want to go a check each and everyone of them, to see if it works in the compiled version.
So, either I simply share with everyone the FULL Project folder that contains everything, or is there a smart & easy way to do this selection?
THANK YOU.
  9 件のコメント
Mark Golberg
Mark Golberg 2022 年 5 月 1 日
Thank you Steven.
Of cource my files are organised and I do use Project for that.
Your "uigetfile" example is not a good. If I allow user to import a file into the system, then most likely I'll do some kind of an analysis with it, so, it's not the use case I'm talking about.
Obviosuly, in the end, I'm doing the manual process, trying to include all the file needed for the GUI to run.
I was looking for a more systematic-bulit-proof process, that can provide me a garantee, that all the files required for the APP to run, would be within reach.
Rik
Rik 2022 年 5 月 1 日
The point of the already compiled file is that it should already include all m files. Therefore asking for identification of all other files doesn't make sense, for reasons Steven pointed out.
I personally use my own system of flags in comments when I call one of my own functions. Not bulletproof, but it works reasonably well. I use it to compose a single large m file, but gathering files for a compilation to exe should also be possible.

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

採用された回答

Image Analyst
Image Analyst 2022 年 4 月 30 日
編集済み: Image Analyst 2022 年 5 月 1 日
You can get a list of all functions that could possibly be run by your program using the attached function. When you compile the main app, these dependent m-files will automatically be included in the compiled executable so there is nothing you need to do to enable that. However if you want to ship your source code somewhere, like upload it to the File Exchange or make a "Source Code" subfolder on your target computer, that would be useful for locating all the m-files that you need to ship.
If there are run-time files of yours that are needed, such as Excel template files, MAT files, sound files, splash images, other data files, etc. you just have to find those. Usually I know what files my app will open. Just to be sure I use the search function to search my code for all extensions that I know I use, such as search for .xlsx, .png, .txt, .wav, .mat, etc.
Of course if there are some that your user specifies as input data while running your function, you can't possibly know what your user will pick. Those are their own files.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by