client: VirtualBox now installs VboxManage to /usr/local/bin. Make detection of VirtualBox work again.

This commit is contained in:
Rom Walton 2015-09-22 10:24:01 -04:00
parent fcb359d2ee
commit bbad0d9d9d
1 changed files with 34 additions and 20 deletions

View File

@ -1224,13 +1224,24 @@ bool isDualGPUMacBook() {
// see if Virtualbox is installed // see if Virtualbox is installed
// //
static const struct dir_vbox_locations {
const char *dir;
} vbox_locations[] = {
{ "/usr/bin/VboxManage" },
{ "/usr/local/bin/VboxManage" },
// add other ifdefs here as necessary.
{ NULL },
};
int HOST_INFO::get_virtualbox_version() { int HOST_INFO::get_virtualbox_version() {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
char cmd [MAXPATHLEN+35]; char cmd [MAXPATHLEN+35];
char buf[256]; char buf[256];
int i = 0;
FILE* fd; FILE* fd;
safe_strcpy(path, "/usr/bin/VBoxManage"); do {
safe_strcpy(path, vbox_locations[i].dir);
if (boinc_file_exists(path)) { if (boinc_file_exists(path)) {
if (access(path, X_OK)) { if (access(path, X_OK)) {
@ -1252,6 +1263,9 @@ int HOST_INFO::get_virtualbox_version() {
} }
} }
++i;
} while (vbox_locations[i].dir != NULL);
return 0; return 0;
} }