2

Possible Duplicate:
Where to put common writable application files?

In my application I have some setting-files, which needs read/write permission and should be accessable by all users.

So far I found in the net is, that microsoft gives you some special folders in Win Vista/7, but none of them fulfills my needs:
1) CSIDL_COMMON_APPDATA => C:\ProgramData, has no write permission
2) CSIDL_APPDATA => is user specifc
3) CSIDL_LOCAL_APPDATA => is user specific

How can I access such folder, which contains APP DATA, is accessable by all users and has read/write permission?

Community
  • 1
  • 1
markus_ja
  • 2,931
  • 2
  • 28
  • 36
  • 1
    Why have you designed a program where any non-administrative user would be able to overwrite some data and ruin the experience for all the other users? – Rob Kennedy Jun 06 '11 at 14:52
  • in most cases shared customer data, when not a db is used. – coding Bott Jun 06 '11 at 14:57
  • [Where to put common writable application files?](http://stackoverflow.com/q/147016) may give some pointers. – Jorik Jun 06 '11 at 14:58
  • These are data which belong to the application, independet who is using it. Furthermore, I don't want to create settings files and folders for every user profile on the computer. – markus_ja Jun 06 '11 at 15:00

1 Answers1

7

on a system wide installation, you have to write them to CSIDL_COMMON_APPDATA. but you have also to set the permissions within your setup.

don't give rights to "everybody" - "authenticated" is better

if you are using windows installer, then you have to take care of users and system installations. if it is a user installation, you have to write to the CSIDL_APPDATA or CSIDL_LOCAL_APPDATA (depending of roaming or not roaming data).

If you understand german take a look in the entwickler magazin 3.2011. there will be a article "Einstellungssache", which is on topic.

MSDN - Data and Settings Management

coding Bott
  • 4,287
  • 1
  • 27
  • 44