How can I know which files are being used by my compiled GUI?
古いコメントを表示
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 件のコメント
Rik
2022 年 4 月 28 日
The m files should be taken care of by the compiler (unless you're using things like eval, in which case it's on you).
I'm not aware of any automated tools to detect the use of other files.
Mark Golberg
2022 年 4 月 28 日
Bruno Luong
2022 年 4 月 28 日
編集済み: Bruno Luong
2022 年 4 月 30 日
Required source code files (not data files or such)
fLists = matlab.codetools.requiredFilesAndProducts('YourGUI.m')
Mark Golberg
2022 年 4 月 30 日
Bruno Luong
2022 年 4 月 30 日
"How can I have a list of all the files that are need to be added to the already compiled exe file?"
How on earth MATLAB can know that? You the app designer you should know what files are needed.
Mark Golberg
2022 年 4 月 30 日
Steven Lord
2022 年 4 月 30 日
Suppose your app calls uigetfile to let the user select a data file to import. Let's say that call tells MATLAB to allow the user to select an XML file that contains configuration data for a particular type of problem. [It doesn't hard-code the name of a specific XML file.] Should the Compiler then look for all XML files on your computer and "figure out" which of those "look like" a configuration file? Or should it depend on you to tell it which configuration files it should include in your application?
Suppose I have created a GUI with hundredrs of different files it rely on? Mat files, JPEG files, xml files, you name it...
Then for your own sake and the sake of developers who may be working on this GUI in the future you should probably have those files organized in some way that makes it easy to distinguish what is needed for what parts of your GUI's functionality. Look at MATLAB itself -- there are hundreds or thousands of MATLAB functions but they're organized into directories that (more or less) all relate to a particular type of capability.
- The graph and network algorithms functions are in the graphfun directory.
- The sparse matrix functions are more or less all in the sparfun directory.
- The string processing functions live in the strfun directory.
When I want to look at one of those functions, knowing generally what "category" it belongs to gives me a good idea where I need to go to look at it. If you have your files organized, you should be able to more easily determine if a category of files need to be included.
The Projects functionality in MATLAB can help with organizing your files, as could using a source control management system..
Now, can't MATLAB really tell me which files needs to be added to the compilation folders? which files need to be shared along with the exe distribution folder?
Not necessarily just from static analysis, no.
Mark Golberg
2022 年 5 月 1 日
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Variables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!