Issue with compiled app when located in Programs folder

3 views (last 30 days)
This is a graphics application developed in App Designer. Two additional files are included in the build: default parameters and gui configuration. User loads the parameters, changes as required, and generates a graphics with the "Run" button. If in update mode every subsequent parameter change via either slider of numeric field data entry produces a callback which delete the UIAxes contents and redraws the data. Other than the two files initial read there is no external I/O other than user GUI.
This works 100% when the .exe is located in user space, anywhere under Documents, for example, but the update mode doesn't work when the .exe is located in Programs. I've inserted debug outputs to a .txt file, but hesitate to invest too much time given I can probably avoid using the normal deployment instalation. Given there are no explicit external dependencies I can't fathom the difference in behavior.

Answers (2)

Image Analyst
Image Analyst on 18 Nov 2022
That's correct. It's not MATLAB -- that's a Windows rule. Windows does not let you store any new files under the C:\program Files folder (unless you're an official installer or setup program). Like it or not, that's the way it is.
So if I have values that I need to save between sessions, for example settings of various controls or results workbooks or whatever, I store them under "C:\users\Public\Documents\MATLAB\My Project Name". Use the fullfile function if you want.
  2 Comments
Richard
Richard on 18 Nov 2022
I'm not storing any data during the session, simply creating visuals. There is subsequent option for specifying a data path and file names for user space storage, but the problem occurs prior to a user request to save either digital or graphical data. In fact the component of the GUI that would save data is not yet implemented.
Image Analyst
Image Analyst on 19 Nov 2022
When the "User loads the parameters" where is that happening? By adjusting controls on the GUI, or by reading in some files from disk? What happens when the user does "changes required"? That all happens (or is supposed to) on the GUI? What if you store the "the two files initial read" in the c:\users\prublic\documents\MATLAB folder but still install the exe under "c:\Program Files\MATLAB\your app" or wherever it is?
If you want people to debug it further, can you upload the .mlapp file and tell us what to do to observe the problem? Like run it, say Go!, see some initial output, then change some parameters, and it should change the displayed data (but it doesn't).

Sign in to comment.


Adi Purwandana
Adi Purwandana on 25 Feb 2023
I'd rather install my standalone app under D:\ directory, and put it along with my project folder
  1 Comment
Image Analyst
Image Analyst on 25 Feb 2023
That's fine. You can install the executable anywhere, and your data anywhere, as long as your user, computer, and program know where everything is.
For users internal to my company I also create a subfolder of the program folder called "Source Code" where I install all the MATLAB source code files that I used to develop the program. That way if years from now someone inherits my program, they will have everything they need to make modifications.

Sign in to comment.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!