How to add configuration files to standalone matlab application?
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sylvain
le 18 Nov 2025 à 12:02
Commenté : Sylvain
le 18 Nov 2025 à 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 commentaires
Harald
le 18 Nov 2025 à 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
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!