Community
Participate
Working Groups
Different versions of Windows have different location of "Application Data" folder, e.g. for Windows XP is "@user.home/Application Data" but for Windows Vista it's "@user.home/Application Data/Roaming". Application we're developing has a requirement to store user profile (in our case workspace with application's specific files) in an Application Data directory. For this purpose we need to have ability to specify @appdata (or whatever it would be called) in config.ini of application. If it's ok by the community, I can provide relevant change in diff format.
We've encountered the same limitation for applications built atop the Eclipse RCP. There is already support for macros in the *.ini file, such as "@user.home". However, the user's home directory is not the expected location for application data on either Windows or Mac. What we need is a cross-platform macro that refers to a platform-specific location for application data. From of the comments on the bug report this raised in our application: ===================================================================== Administrators have tools for backing up and managing these different areas and placing data in custom locations. Not following standards may break many of the tools functionality. Because of issues like this, various compatibility certifications may require using the appropriate sub-directories. Similar principles should apply to following Apple's guidelines on where to store application data on Mac OS X. Basic information: http://msdn.microsoft.com/en-us/library/ms995853.aspx Some Java usage tips: http://stackoverflow.com/questions/1198911/how-to-get-local-application-data-folder-in-java How to access the proper directories with compatibility for different OS versions: http://blogs.msdn.com/b/patricka/archive/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions.aspx
If a JNA dependency is acceptable, we adapted this code (http://stackoverflow.com/questions/585534/what-is-the-best-way-to-find-the-users-home-directory-in-java) to look up a CSIDL value from SHGetFolderPath (ok for XP, deprecated for Vista/7). I assume looking up a KNOWNFOLDERID from SHGetKnownFolderPath would be very similar (ok for Vista/7).
*** This bug has been marked as a duplicate of bug 241192 ***