AppDesigner Packaging Data Files Location
Show older comments
Packaged an EXE with MATLAB Compiler -- on install, accepted default location and let it put a shortcut on the desktop.
That went ok, but the datafile associated with the application it uses to save the previous state on restart was also placed on the desktop and so isn't being found.
How do you make it put the datafile in the same location as the executable on install. I've a problem here that I don't have administrator rights so can't just move it myself without calling in IT.
5 Comments
Mario Malic
on 27 Oct 2022
Edited: Mario Malic
on 27 Oct 2022
What about writing into the user account folder (tested on Windows, I don't know what's up with other OSs)?
C:\Users\%USERNAME%\
You can write to the documents, pictures and music sub folders, AppData\Roaming or AppData\Local\ etc...
getenv("APPDATA")
getenv("LOCALAPPDATA")
getenv("USERPROFILE")
dpb
on 27 Oct 2022
Mario Malic
on 27 Oct 2022
What I ment is to modify the code in the app to save/edit/look for the internal data file in one of the mentioned environment variables (I assume that user doesn't need admin rights to play with the files in those folders).
dpb
on 27 Oct 2022
Answers (1)
dpb
on 29 Oct 2022
0 votes
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!