Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Windows is any folder alternative to ProgramData?

I'm writing a desktop app and need a folder which...

  • Exists in Windows 7 and Vista
  • Is common to all users (for store config data).
  • Application can save data on it, without Admin privileges (not like "ProgramData").
  • is standard (I don't want to create another app specific folder in "C:", the Desktop or other place alike.)
  • "Program Files" is not an option, of course.

Can you suggest an appropriate folder, or better use the Registry?

like image 972
Néstor Sánchez A. Avatar asked Dec 22 '22 05:12

Néstor Sánchez A.


1 Answers

The recommended way to do this is to create a folder at install time, dedicated to your application, underneath "ProgramData" (i.e. CSIDL_COMMON_APPDATA/FOLDERID_ProgramData).

As you already know, the CSIDL_COMMON_APPDATA folder is read only for standard users. So your install program needs to give the folder that it creates an ACL that permits the access that you require.

This is the solution that meets all the criteria laid out in your bullet points.

You mention the registry. There is no area of the registry that is shared between all users and yet writeable by standard users. Whilst you can use ACLs to grant more permissive access rights to the registry, it is really not the done thing. Please forget that I even mentioned this possibility!

like image 165
David Heffernan Avatar answered Jan 07 '23 16:01

David Heffernan