diff --git a/clientscr/mac_saver_module.cpp b/clientscr/mac_saver_module.cpp index 80060380ef..a9618f321d 100644 --- a/clientscr/mac_saver_module.cpp +++ b/clientscr/mac_saver_module.cpp @@ -370,22 +370,26 @@ OSStatus CScreensaver::initBOINCApp() { if (++retryCount > 3) // Limit to 3 relaunches to prevent thrashing return -1; -#ifdef _DEBUG - err = -1; -#else - err = GetpathToBOINCManagerApp(boincPath, sizeof(boincPath)); -#endif - if (err) - { // If we couldn't find BOINCManager.app, try default path - strcpy(boincPath, "/Applications/"); - if (brandId) - strcat(boincPath, m_BrandText); - else - strcat(boincPath, "BOINCManager"); - strcat(boincPath, ".app"); + // Find boinc client within BOINCManager.app + // First, try default path + strcpy(boincPath, "/Applications/"); + if (brandId) { + strcat(boincPath, m_BrandText); + } else { + strcat(boincPath, "BOINCManager"); + } + strcat(boincPath, ".app/Contents/Resources/boinc"); + + // If not at default path, search for it by creator code and bundle identifier + if (!boinc_file_exists(boincPath)) { + err = GetpathToBOINCManagerApp(boincPath, sizeof(boincPath)); + if (err) { + saverState = SaverState_CantLaunchCoreClient; + return err; + } else { + strcat(boincPath, "/Contents/Resources/boinc"); + } } - - strcat(boincPath, "/Contents/Resources/boinc"); if ( (myPid = fork()) < 0) return -1;