Solved

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

Posted on 2006-10-27
5
215 Views
Last Modified: 2013-12-23
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?  

0
Comment
Question by:DMTrump
  • 3
  • 2
5 Comments
 

Author Comment

by:DMTrump
Comment Utility
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.
0
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
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.
0
 

Author Comment

by:DMTrump
Comment Utility
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?
0
 
LVL 82

Accepted Solution

by:
oBdA earned 250 total points
Comment Utility
The network path for the common data is something that should be configured in the application settings, so that the administrator can decide where to put it (and change it later on, if the server moves or whatever).
AppDataAll is a common path for all users on a workstation, and it's (usually) a local path on the workstation; as I said, this is *NOT* part of any roaming profile, and it's of no use for data that should be available network wide.
0
 

Author Comment

by:DMTrump
Comment Utility
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!



0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now