Windows – Where to Store writable data to be shared by all users in a vista installer

aclinstallationnsiswindows-vista

My app is installed via NSIS.

I want the installer to install the program for all users.

I can do this, by installing to the 'program files' directory.

There is a database file (firebird), that all user accounts on the system should share.

If I store this database file in the 'program files' directory it will be read only.

If I store it in the users APPDATA directory they will each have a different copy, when one user adds data the others wont see it.

Option 1 – In my app directory under 'program files' create a 'Data' directory, in my installer make this dir read-writeable by all, that way the user 'program files' virtualisation won't kick in and all users can update the file and see each others changes.

Any other options ?

Best Answer

Data for all users should be stored in %ALLUSERSPROFILE%, or call SHGetFolderPath() with the parameter CSIDL_COMMON_APPDATA to get the all users storage area.

See http://www.deez.info/sengelha/2006/02/28/windows-vista-changes/ for more details.