views:

664

answers:

3

Hello all,

I thought that CSIDL_COMMON_APPDATA\company\product should be the place to put files that are common for all users of the application and that the application can modify, however, on Vista this is a read-only location, unless modified by the installer (as per MSDN - http://msdn.microsoft.com/en-us/library/ms995853.aspx), so... what's best? Modify the location's security settings to allow writing or use CSIDL_COMMON_DOCUMENTS\company\product instead? Maybe there's a third option?

Also, is there an "official" Microsoft recommendation on this somewhere?

Thanks in advance.

+1  A: 

I think this post may answer some questions, but it seems a difficult problem for many.

Apparently, CSIDL_COMMON_DOCUMENTS provides a common workaround

TheSoftwareJedi
Sorry, I fail to see how that answers the question. I know how to get the path, I'm asking what's the proper path to get.
dennisV
Yes, thanks. Too bad there's no official answer to this problem.
dennisV
+5  A: 

Modify just the security on a specific sub-directory of the AppData directory (this is from the link you provided):

CSIDL_COMMON_APPDATA This folder should be used for application data that is not user specific. For example, an application may store a spell check dictionary, a database of clip-art or a log file in the CSIDL_COMMON_APPDATA folder. This information will not roam and is available to anyone using the computer. By default, this location is read-only for normal (non-admin, non-power) Users. If an application requires normal Users to have write access to an application specific subdirectory of CSIDL_COMMON_APPDATA, then the application must explicitly modify the security on that sub-directory during application setup. The modified security must be documented in the Vendor Questionnaire.

1800 INFORMATION
Yes, that's what I'm thinking as well. But it does seem like they (Microsoft) don't want you to put files in there and instead use the COMMON_DOCUMENTS one. Thanks.
dennisV
Where do you get that they don't want you to put files there? It looks like they are quite happy with you putting files there - you should put them in your own sub-directory, and manage the security correctly.
1800 INFORMATION
I suppose so, but modifying the security is an extra step that I assume (perhaps wrongly) is placed there to discourage people from using this folder for writable files.
dennisV
No it's an extra step to ensure that app data files remain isolated from each other. You are then forced to think about what users should have access and give it accordingly.
1800 INFORMATION
Yes, I agree about that.
dennisV
+1  A: 

Guidelines for Vista/UAC can be found here. Search that page for "CSIDL" and you'll find some "official" answers.

Lette
Thanks - it all points to the directory I was originally planning to use. I guess it's the right answer then :)
dennisV
It's a nice warm feeling finding out that you were right all along, isn't it? ;-)
Lette