Where to store recorded data for sharing by all users in the Vista installer?

My application is installed through NSIS.

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

I can do this by installing the "program files" directory.

There is a database file (firebird) that all user accounts in the system should use.

If I save this database file in the "program files" directory, it will be read-only.

If I save it in the APPDATA user directory, each of them will have a different copy, when one user adds data, others will not be able to see it.

Option 1 - In the application directory under the "program files" create the "Data" directory, in my installer make this drive readable by everyone, so the virtualization of user "program files" will not start and all users can update the file and see each other’s changes friend.

Any other options?

+4
source share
4 answers

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

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

+4
source

Somewhere under the "All Users" profile there will be an obvious place. I think there are some rules about who gets read / write by default, but MS documentation recommends if you need something else to create a subdirectory and set the ACL directly in the installer.

+3
source

In particular, I would use:

SetShellVarContext all SetOutPath $APPDATA File "MyInsecurelySharedFile.txt" 

See the NSIS Script Reference for more information.

0
source

Source: https://habr.com/ru/post/1277013/


All Articles