Link to home
Start Free TrialLog in
Avatar of DMTrump
DMTrumpFlag for United States of America

asked on

Where to store data and settings for ALL USERS in a roaming profile environment?

I am going to be deploying a custom application on a clients network.
The application requires access to both User specific data and global
data that needs to be available to all users whoever they are and
wherever they log in (with their roaming profile).  The User Specific info I am storing in:

Documents and Settings\[UserName]\Application Data\MyCustomApp\

As I understand - that will be available to a given user no matter what workstation they log in on.

But how about "All User Data"
Is the same:

Documents and Settings\All Users\Application Data\MyCustomApp\

Folder available to all users no matter where they log in? All users will need to be able to read and write into that directory.  

If that is not the case, what IS the proper way to handle data that needs to be commonly available and shared by all users of an application?  And if it is not the return from the API call ShGetSpecialFolderPath with a CSIDL_APPDATAALL ($0023) What IS the proper call to get to the right place to read and write such data?  

Avatar of DMTrump
DMTrump
Flag of United States of America image

ASKER

Is this so difficult?  In that case, I've increased the point value.

Or is it so simple you don't think it's worth answering?  

If you can give me the answer to this question - please do - earn some points!  

I need to know because I do not have access to a server based Windows network from my development system and I need to have the correct method in place before traveling to my clients site.
Avatar of oBdA
oBdA

To start with, do NOT, never, ever, use a hardcoded "Documents and Settings\[UserName]" to access a user's profile. Either use the environment variable %Userprofile%, or use the proper API call to retrieve the user's profile path. Neither "C:\Documents and settings" nor the user profile folder name is a given.
For a user's application data, there's another environment variable %AppData%, and likely a matching API call.

Now, as far as the global settings are concerned, it won't help you anything to store that locally. A roaming user profile is *user* specific, so all that will be roaming is the user's profile folder. Apart from that, how would you share this data network wide if it's stored locally on the machines?
If this data needs to be available for all users at all times, it has to be stored i a network share, not on the machines.
Avatar of DMTrump

ASKER

Thanks - and your reminder to not use hard-coded paths may help someone else - but I was not doing that anyway.  I'm using the returns from the API call ShGetSpecialFolderPath.  Using a CSIDL_ constant for each path I need.

My question phrased more simply is: Does the path returned by ShGetSpecialFolderPath with  CSIDL_APPDATAALL  point to a directory on the network or is it transfered to the user when his or her profile is loaded?  I sounds as though it is the later.  So I need a call to find a read/writable place on the network.  Is there a CSIDL_ constant that can find that for me?

So you've answered half my question - Now I need method to reliably find a share drive on the network.  Or maybe that can't be determined from a User's computer and has to be set by the network admin seperately for each installation of the application?
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DMTrump

ASKER

Thanks!  

I also found a much more thorough list of CSIDLs that help explain what I needed to know at
http://tinyurl.com/7hei 
There is for instance a:
CSIDL_NETWORK (0x0012) A virtual folder representing Network Neighborhood, the root of the network namespace hierarchy.
But nothing specific for a commonly accessable work space.  As you said - that is something that seems to be a destination that the Admin must supply to each instance.

I <MUST> get a server based network set up for myself so I can learn more about this stuff!