Where do you store long term properties etc. in Windows?

R

Ross

Hi all. Very basic question here. On Linux or Mac, when you want your
program to have some long term memory, then you create a directory in
the user's home directory called ".application" or whatever. You can
then store a config file, etc., in there. Once you have this, you can
have config properties that specify temporary directories etc.

What do people do for this on Windows? Where do they put config files
etc. so that the program knows where to access them?
 
R

Roedy Green

What do people do for this on Windows? Where do they put config files
etc. so that the program knows where to access them?

You can use Java Web Start and let it define the directory.
See http://mindprod.com/jgloss/javawebstart.html

You can use the Preferences mechanism to store config stuff in the
registry. See http://mindprod.com/jgloss/preferences.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

There is one brain organ that is optimised for understanding and articulating logical processes, and that is the outer layer of the brain, called the cerebral cortex. Unlike the rest of the brain, this relatively recent evolutionary development is rather flat, only about 0.32 cm (0.12 in) thick, and includes a mere 6 million neurons. This elaborately folded organ provides us with what little competence we do possess for understanding what we do and who we do it.
~ Ray Kurzweil (born: 1948-02-12 age: 61)
 
G

GArlington

Hi all. Very basic question here. On Linux or Mac, when you want your
program to have some long term memory, then you create a directory in
the user's home directory called ".application" or whatever. You can
then store a config file, etc., in there. Once you have this, you can
have config properties that specify temporary directories etc.

What do people do for this on Windows? Where do they put config files
etc. so that the program knows where to access them?

Did you look in "c:/Documents and Settings/currentUserName" == HOME
 
K

Knute Johnson

Ross said:
Thanks for those suggestions. java.util.prefs.Preferences seems the
best bet.

You should use the same thing for both linux and windoze as GArlington
suggested. That way the same code runs on both OS.
 
R

Ross

You should use the same thing for both linux and windoze as GArlington
suggested. That way the same code runs on both OS.

Yes, that's my intention. It would be possible to have code that
checked the OS, and applied different policies depending on the
underlying OS. But I'm planning to only store the location of the
working directory through properties, and then store the config file
in the working directory. I may make a different suggestion of the
default location in a dialog I pop up on first run though.
 
A

Arne Vajhøj

GArlington said:
Did you look in "c:/Documents and Settings/currentUserName" == HOME

That is in many ways the correct solution.

Just note that many Windows users does not have that
location on their radar screen at all.

If the application is for typical one user per PC users,
then putting the config file in the same dir as the app
may make sense, because the distinction between system
and user is non-existing.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top