- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
// parse from the uninstall, the actuall installation path
try {
int jarLoc = uninstallDir.indexOf("-jar");
String s = uninstallDir.substring(jarLoc + 5);
// turn it into a normalized file
int uniLoc = s.indexOf("uninstaller");
s = s.substring(1,uniLoc);
s = s.replace("\\", "/");
if(s.endsWith("/"))
s = s.substring(0,s.length()-1);
File f = new File(s);
if(!f.exists()) {
throw new Exception("installation directory does not exist: " + s);
}
return f;
}
catch(Exception e) {
throw new Exception("installation directory could not be parsed from: " + uninstallDir);
}
guest 22.10.2009 05:14 # 0