From aa2069d0c47ff86a00a525de35b540bf6e52c019 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 10 Jun 2009 10:49:46 +0000 Subject: [PATCH] Mac: add screensaver, installer and uninstaller support for ProgressThruProcessors branding svn path=/trunk/boinc/; revision=18347 --- checkin_notes | 10 ++ clientscr/mac_saver_module.cpp | 3 + mac_installer/PostInstall.cpp | 187 ++++++++++++++++++--------------- mac_installer/uninstall.cpp | 13 ++- 4 files changed, 126 insertions(+), 87 deletions(-) diff --git a/checkin_notes b/checkin_notes index 57fa2ffde4..f258ce8983 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5212,3 +5212,13 @@ Charlie 9 June 2009 lib/ filesys.cpp + +Charlie 10 June 2009 + - Mac screensaver: Add support for ProgressThruProcessors (PTP) branding. + - Mac PTP Installer: Add support for ProgressThruProcessors (PTP) installer. + + clientscr/ + mac_saver_module.cpp + mac_installer/ + PostInstall.cpp + uninstall.cpp diff --git a/clientscr/mac_saver_module.cpp b/clientscr/mac_saver_module.cpp index 4cc5a37d0d..f97ba99b8b 100644 --- a/clientscr/mac_saver_module.cpp +++ b/clientscr/mac_saver_module.cpp @@ -251,6 +251,9 @@ OSStatus CScreensaver::initBOINCApp() { case 1: m_BrandText = "GridRepublic"; break; + case 2: + m_BrandText = "ProgressThruProcessors"; + break; default: m_BrandText = "BOINC"; break; diff --git a/mac_installer/PostInstall.cpp b/mac_installer/PostInstall.cpp index fb86b84479..193376acfd 100755 --- a/mac_installer/PostInstall.cpp +++ b/mac_installer/PostInstall.cpp @@ -59,8 +59,14 @@ void strip_cr(char *buf); extern int check_security(char *bundlePath, char *dataPath, int use_sandbox, int isManager); +#define NUMBRANDS 3 static Boolean gQuitFlag = false; /* global */ +static char *brandName[NUMBRANDS]; +static char *appName[NUMBRANDS]; +static char *appNameEscaped[NUMBRANDS]; + + enum { launchWhenDone, logoutRequired, @@ -87,8 +93,8 @@ int main(int argc, char *argv[]) pid_t installerPID = 0, coreClientPID = 0; FSRef fileRef; OSStatus err, err_fsref; - char *p; FILE *f; + char s[256]; #ifdef SANDBOX uid_t savedeuid, b_m_uid; passwd *pw; @@ -96,9 +102,20 @@ int main(int argc, char *argv[]) #else char *q; group *grp; - char s[256]; #endif + appName[0] = "/Applications/BOINCManager.app"; + appNameEscaped[0] = "/Applications/BOINCManager.app"; + brandName[0] = "BOINC"; + + appName[1] = "/Applications/GridRepublic Desktop.app"; + appNameEscaped[1] = "/Applications/GridRepublic\\ Desktop.app"; + brandName[1] = "GridRepublic"; + + appName[2] = "/Applications/ProgressThruProcessors Desktop.app"; + appNameEscaped[2] = "/Applications/ProgressThruProcessors\\ Desktop.app"; + brandName[2] = "ProgressThruProcessors"; + for (i=0; id_name); system (s); - // Set screensaver to "Computer Name" default screensaver only if it was BOINC or GridRepublic. + // Set screensaver to "Computer Name" default screensaver only + // if it was BOINC, GridRepublic or ProgressThruProcessors. changeSaver = false; f = popen("defaults -currentHost read com.apple.screensaver moduleName", "r"); if (f) { @@ -394,6 +399,8 @@ static OSStatus CleanupAllVisibleUsers(void) changeSaver = true; if (strstr(s, "GridRepublic")) changeSaver = true; + if (strstr(s, "ProgressThruProcessors")) + changeSaver = true; pclose(f); } @@ -540,6 +547,8 @@ static void DeleteLoginItem(void) Success = RemoveLoginItemAtIndex(kCurrentUser, Counter-1); if (strcmp(p, "GRIDREPUBLIC DESKTOP.APP") == 0) Success = RemoveLoginItemAtIndex(kCurrentUser, Counter-1); + if (strcmp(p, "PROGRESSTHRUPROCESSORS DESKTOP.APP") == 0) + Success = RemoveLoginItemAtIndex(kCurrentUser, Counter-1); } }