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

38 views (last 30 days)
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?
Mark Golberg
Mark Golberg on 1 May 2022
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 on 1 May 2022
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.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 30 Apr 2022
Edited: Image Analyst on 1 May 2022
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.

More Answers (0)


Find more on Develop Apps Using App Designer in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!