AppDesigner Packaging Data Files Location
显示 更早的评论
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 个评论
Mario Malic
2022-10-27
编辑:Mario Malic
2022-10-27
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
2022-10-27
Mario Malic
2022-10-27
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
2022-10-27
回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!