Open GoogleCodeExporter opened 9 years ago
Hmm, are you running into problems because of the current setting? It's always
hard to know what's going to happen when you change things like this, so it
probably only makes sense if people are having problems with the current
behavior.
Looking at Processing, they take yet another approach to this
(http://code.google.com/p/processing/source/browse/trunk/processing/app/src/proc
essing/app/windows/Platform.java):
// looking for Documents and Settings/blah/Application Data/Processing
public File getSettingsFolder() throws Exception {
// HKEY_CURRENT_USER\Software\Microsoft
// \Windows\CurrentVersion\Explorer\Shell Folders
// Value Name: AppData
// Value Type: REG_SZ
// Value Data: path
//String keyPath =
// "Software\\Microsoft\\Windows\\CurrentVersion" +
// "\\Explorer\\Shell Folders";
//String appDataPath =
// Registry.getStringValue(REGISTRY_ROOT_KEY.CURRENT_USER, keyPath, "AppData");
// Fix for Issue 410
// Java 1.6 doesn't provide a good workaround (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519127)
// Using JNA and SHGetFolderPath instead.
char[] pszPath = new char[Shell32.MAX_PATH]; // this will be contain the path if SHGetFolderPath is successful
int hResult = Shell32.INSTANCE.SHGetFolderPath(null, Shell32.CSIDL_APPDATA, null, Shell32.SHGFP_TYPE_CURRENT, pszPath);
if (Shell32.S_OK != hResult){
throw new Exception("Problem city, population your computer");
}
String appDataPath = new String(pszPath);
int len = appDataPath.indexOf("\0");
appDataPath = appDataPath.substring(0, len);
// DEBUG
//throw new Exception("win: " + appDataPath);
return new File(appDataPath, "Processing");
}
There's more detail in their issue:
http://code.google.com/p/processing/issues/detail?id=410. This seems like it's
probably the best way to solve this problem, if people are having one.
Original comment by dmel...@gmail.com
on 17 Jul 2012 at 3:24
Original issue reported on code.google.com by
mariusz....@gmail.com
on 6 Jun 2012 at 8:18