📜 ⬆️ ⬇️

Where does the program store its settings?

There is a program that must save and load some settings: the position and size of the main program window, the identifier of the selected language, the time of the last update check. I wondered - where should the program store its settings? I decided to collect information on this topic and share it with you.

Possible folders for storing program settings and files:
Program Files
It is not recommended to store settings in the folder of the program itself, the user may simply not have enough rights to write and read the program directory. Plus (or rather, minus) user settings will be shared, no one will be able to customize the program for themselves, or store only personal data in it.

My documents
XP : Documents and Settings \ User \ My Documents
Vista : Users \ User \ Documents
In my opinion not the right approach. The folder is not for nothing called My Documents . Therefore, if the program does not generate any documents, but only has to store its settings, then there is no place for them. I do not know about you, but I am slightly annoyed by the folders inside the document folder. I arrange them there, by the way, I arrange them, stuff them into subdirectories, and then you, I go to the folder and see Visual Studio 2008 .
')
User \ Application Data
XP : Documents and Settings \ User \ Application Data
Vista : Users \ User \ AppData \ Roaming
Files from this folder are part of roaming profiles ( per-user ). Those. if you want your program data to be moved with your user profile, store it in this folder.

User \ Local Settings \ Application Data
XP : Documents and Settings \ User \ Local Settings
Vista : Users \ User \ AppData \ Local
In this folder, you can store files that are not part of relocatable profiles ( per-user-per-machine ), as well as temporary and large-sized files that are either not required to be moved (temporary, cache, other garbage), or it will take considerable time (keep the file a couple of hundred megabytes in size in the roaming profile and the user will definitely say thank you).

All Users \ Application data
XP : Documents and Settings \ All Users \ Application Data
Vista : ProgramData
In this folder, you can store files that are common to all computer users, such as a common database, a set of common documents, clipart, etc. This folder is not included in the per-machine roaming profile. Regular users (not administrators) have access to this folder in read-only mode.

Source: https://habr.com/ru/post/70922/


All Articles