Where to place global application data in Vista?

Where on Windows (Vista) should I put data that should be readable and writable by everyone, that is, every computer user? Vista concepts C: \ Users \ xxx \ AppData \ something, C: \ Program Files and C: \ ProgramData directories and UAC are a little confused.

Also, is there a turnkey solution for defining these places with Java? I believe this requires some interaction with the native libraries, since System.getProperties only has user.home and user.dir, none of which are writable globally.

+3
source share
4 answers

vista c:\ProgramData , , C:\Documents and Settings\AllUsers\AppData XP.

java.. ALLUSERSPROFILE , . , .

+5

, , , "Common Application Data", .

: ?

+5

If the data is really large, you can take a look at the settings API ; in particular Preferences.systemNodeForPackage. This gives you a platform-independent, system-wide, back-agnostic repository if that's what you need.

+2
source

Also, is there any ready-made solution for locating these locations with Java?

You can check approrpirate environment variables, for example% PROGRAMDATA%,% PROGRAMFILES% and others.

+1
source

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


All Articles