Hello everybody!

My latest question is this: I am considering adding user customization to a program I'm writing. For instance, tracking most recently used files, colour schemes, etc. I am considering two ways to implement this:

1) creating a "user" subdirectory and store files like chorus.usr or similar which would correspond to login ids and contain the various settings.
2) storing the custom settings in the registry under the current user.

What do people think is the best solution? I'm leaning towards the first one because I would like to make the user settings portable (in case they move to another computer or want to share settings). However, if I store it in the registry, I wouldn't need to ask the user to type in a login everytime they start the app... but then, I wouldn't be able to change the user without logging on/off.

Any ideas??

Posted on 2002-05-15 14:26:28 by chorus
How about a combination then? I prefer keeping things out of the registry if at all possible.

Login stuff in the registry and possibly a file name for the .usr file. Every thing else can go in the .usr.
Posted on 2002-05-15 14:46:10 by Graebel
I would use second way, but with INI files :)
If you have to store multiple files like small databases, datafiles then go for the subdirs. Or a combination of both ;)

Edit: posted at same time, Graebel :)
Posted on 2002-05-15 14:46:47 by bazik
Only the second option has security. Allow the current user to export their settings from the registry and import them into another system/user. So, I vote for both.

Posted on 2002-05-15 14:48:35 by bitRAKE
Thanks for all the replies!

I think I'll roll with Graebal's and Bazik's suggestion. Keep one key in the registry that points to a default user file/folder for that particular user. That way, I can read it from the key without prompting the user, and still allow the user to change while running the app.

bitRAKE: regarding security. Although at the moment I'm not planning anything very secure, I might in the future. I'm thinking of doing a basic encryption on the ini files themselves (user enters a password which acts like a key to decrypt the ini). I'm not planning on storing very valuable data in the ini files, and I still want them to move from machine to machine if necessary.

Thanks for your opinions everybody!

Posted on 2002-05-15 15:19:50 by chorus