more work on windows registry

This commit is contained in:
benfry
2005-01-30 19:20:20 +00:00
parent 51961371e7
commit 8b31f221c7
3 changed files with 25 additions and 4 deletions

View File

@@ -210,9 +210,13 @@ public class PdeBase {
"\\Explorer\\Shell Folders";
RegistryKey localKey = topKey.openSubKey(localKeyPath);
String appDataPath = localKey.getStringValue("AppData");
System.out.println("app data path is " + appDataPath);
System.exit(0);
//System.out.println("app data path is " + appDataPath);
//System.exit(0);
topKey.closeKey(); // necessary?
localKey.closeKey();
return new File(appDataPath, "Processing");
} catch (Exception e) {
showError("Problem getting data folder",
"Error getting the Processing data folder.", e);
@@ -276,6 +280,23 @@ public class PdeBase {
// Value Type: REG_SZ
// Value Data: path
try {
RegistryKey topKey = Registry.HKEY_CURRENT_USER;
String localKeyPath =
"Software\\Microsoft\\Windows\\CurrentVersion" +
"\\Explorer\\Shell Folders";
RegistryKey localKey = topKey.openSubKey(localKeyPath);
String personalPath = localKey.getStringValue("Personal");
topKey.closeKey(); // necessary?
localKey.closeKey();
return new File(personalPath, "Processing");
} catch (Exception e) {
showError("Problem getting documents folder",
"Error getting the Processing sketchbook folder.", e);
}
}
return null;

View File

@@ -1,6 +1,6 @@
#!/bin/sh
CLASSPATH=java/lib/rt.jar:lib:lib/build:lib/pde.jar:lib/core.jar:lib/antlr.jar:lib/oro.jar:lib/mrj.jar
CLASSPATH=java/lib/rt.jar:lib:lib/build:lib/pde.jar:lib/core.jar:lib/antlr.jar:lib/oro.jar:lib/registry.jar:lib/mrj.jar
export CLASSPATH
# put the directory where this file lives in the front of the path, because

View File

@@ -89,7 +89,7 @@ cd ../..
cd app
CLASSPATH="../build/linux/work/lib/core.jar:../build/linux/work/lib/mrj.jar:../build/linux/work/lib/antlr.jar:../build/linux/work/lib/oro.jar:../build/linux/work/java/lib/rt.jar"
CLASSPATH="../build/linux/work/lib/core.jar:../build/linux/work/lib/mrj.jar:../build/linux/work/lib/antlr.jar:../build/linux/work/lib/oro.jar:../build/linux/work/lib/registry.jar:../build/linux/work/java/lib/rt.jar"
../build/linux/work/jikes +D -classpath $CLASSPATH -d ../build/linux/work/classes *.java jeditsyntax/*.java preprocessor/*.java tools/*.java