Windows 7 - where and how can I store user-independent data?

I have an application (32-bit C ++) running under XP that I need to adapt to work under Windows 7 and Vista. It should store several tens of bytes of data that are independent of the user. In XP, I saved the data in the registry under HKEY_LOCAL_MACHINE \ Software. When I run the application in Windows 7, the registry entries are virtual and each user receives a separate copy of the data.

A non-virtual registry seems like a logical place for data, but I have no idea how to do this. I note that there are many applications that actually store data there; how do they do it?

I also want to store data even where there is some well-known global repository? The only small file is all I need.

I am more or less not aware of all rights / privileges, so any hints, pointers, etc. very much appreciated.

+5
source share
3 answers

One of the design goals of Windows 7 is to highlight user data and applications. This is done to improve privacy, security and customization. In fact, standard users in Win 7 cannot modify the data of other users.

System.Environment.SpecialFolder . : . , CommonApplicationData , , , .

, , , , . , , , ApplicationData, . . , .

, Win7 , . , . , . , , . , , . , , .

, Win7 , , , IP-. , .

+2

, , , . , ADMIN (ALLUSERS = 1). , , ADMIN, , ADMIN .

, , ADMIN User ( ), - (HKLM\SOFTWARE\package) \ \?

ADMIN (ALLUSERS = 1).msi .

0

, , , ( INI , r + w), - , , ?

We need to read / write (under Windows 7 / Vista): Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData) + @ "\ GoScan \ GoScan.ini"

but, like others, they found that permission for the average user is not enough for r + w. Is it an β€œacceptable” practice to change the directory / file permissions after the installation is complete or, possibly, during the installation (not sure where to do this in the VS 2008 project).

-Paul

0
source

All Articles