OK, true confession first: Maybe it's just me, but sometimes "best practices for program settings" on Windows machines feels like it's changed more than Microsoft's data access strategies. I'm still running XP, and somewhere along the way just kind "glazed over" about where MS wanted me to store all my app's data, etc. I controlled all the machines I coded for, so it really didn't matter.
Now I'm writing apps for "in the wild," supporting Win98SE on up. I have to pay attention to all this again. :-\
For reasons having to do mostly with easy migration to new computers, I'm not a big fan of using the registry for app settings -- I prefer using INI files, and have some older INI components that I use for the task (Raize, usually). I'm open to suggestions to other third-party components, if they'll make this easier / less hassle.
Basically, I need to store app settings (like remembering option settings, etc).
I've read:
Registry vs. INI file for storing user configurable application settings
Where to store program settings instead of HKEY_LOCAL_MACHINE?
Where should my win32 program keep its files?
Best place to store configuration files and log files on Windows for my program?
...so at least I'm not alone in this question... ; )
(w/apologies for what is somewhat of a repeat question, albeit from a slightly different angle).
It SOUNDS like I can just use %APPDATA%/MyProgram, and store all data there, BUT is this UNIVERSALLY TRUE across all Windows flavors from Win98SE on up? If not, what's the best approach, and when did that approach come into existence?
What I'm really looking for, honestly, is the easiest way to make this problem go away -- I just want one (if possible), simple, easy, reliable way to grab "My Program's Data Folder" in any and all instances. Will the above accomplish that?
Head over to Making Delphi programs Vista-Ready and scroll down to the bottom for: "Where to save your application data?"
function GetRoamingUserAppDataPath : string; //works so long as people have at least IE 4. (and Win95 or better)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With