dont throw exception if vmware is not installed

This commit is contained in:
Doug MacEachern 2006-12-05 06:16:42 +00:00
parent f1cc21d7b5
commit d18f0b751f
1 changed files with 9 additions and 2 deletions

View File

@ -175,12 +175,17 @@ public class VMControlLibrary {
out = new File(out, VMCONTROL_SO); out = new File(out, VMCONTROL_SO);
} }
setSharedLibrary(out.getPath()); boolean exists = out.exists();
if (out.exists()) { if (exists) {
setSharedLibrary(out.getPath());
return; //already linked return; //already linked
} }
if (!new File(VMCONTROL_TAR).exists()) {
return; //VMware not installed
}
File dir = out.getParentFile(); File dir = out.getParentFile();
if (!(dir.isDirectory() && dir.canWrite())) { if (!(dir.isDirectory() && dir.canWrite())) {
throw new IOException("Cannot write to: " + dir); throw new IOException("Cannot write to: " + dir);
@ -216,6 +221,8 @@ public class VMControlLibrary {
}; };
exec(link_args); exec(link_args);
setSharedLibrary(out.getPath());
} }
public static boolean isLoaded() { public static boolean isLoaded() {