How to add configuration files to standalone matlab application?
13 views (last 30 days)
Show older comments
Sylvain
on 18 Nov 2025 at 12:02
Commented: Sylvain
on 18 Nov 2025 at 14:48
I am stuck at developping my standalone application.
I have a user data file that is called "preferences.toml" it is a typical config file, that is being modified by the user. It cannot be stored on C:\Program Files applications for obvious reasons that it will be modified by the user.
The file will be stored in the APDATA/Roaming/Author Name/App Name, the folder is automatically detected or created. But now I want to copy/paste a default config file.
I attached the file/folder linck to the user_data

But at compilation, the folder is not created

2 Comments
Harald
on 18 Nov 2025 at 13:16
Hi,
are you getting any error messages? To ensure that you observe any error messages, start the executable from a system console rather than by double-clicking it.
Another problem may be that APPDATA/Roaming/Author Name/App Name may not exist on the end user's machines. You can use getenv("USERNAME") to obtain the login name.
If the file is temporary, it might also be an alternative to store it in the folder returned by tempdir.
If the above does not help, it would be great if you can provide a minimal reproduction example.
Best wishes,
Harald
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown 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!