diff --git a/checkin_notes b/checkin_notes
index 48ec17408b..eca6a60a09 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -9550,3 +9550,10 @@ David 25 July 2005
client/
cs_scheduler.C
+
+Charlie 25 July 2005
+ - Mac installer: specifically quit core client if running in addition
+ to quitting BOINC Manager, since cc may be running without manager.
+
+ mac_installer/
+ PostInstall.cpp
diff --git a/mac_build/English.lproj/InfoPlist.strings b/mac_build/English.lproj/InfoPlist.strings
index f9265beb11..6cc5e66ee2 100755
--- a/mac_build/English.lproj/InfoPlist.strings
+++ b/mac_build/English.lproj/InfoPlist.strings
@@ -1,5 +1,5 @@
/* Localized versions of Info.plist keys */
CFBundleName = "BOINC";
-CFBundleShortVersionString = "BOINC version 4.71";
-CFBundleGetInfoString = "BOINC version 4.71, Copyright 2005 University of California.";
+CFBundleShortVersionString = "BOINC version 4.72";
+CFBundleGetInfoString = "BOINC version 4.72, Copyright 2005 University of California.";
diff --git a/mac_build/Info.plist b/mac_build/Info.plist
index 3dc38d0f54..6c9729c928 100644
--- a/mac_build/Info.plist
+++ b/mac_build/Info.plist
@@ -17,6 +17,6 @@
CFBundleSignature
BNC!
CFBundleVersion
- 4.71
+ 4.72
diff --git a/mac_build/Installer-info.plist b/mac_build/Installer-info.plist
index fed50552d5..b467c67a48 100644
--- a/mac_build/Installer-info.plist
+++ b/mac_build/Installer-info.plist
@@ -15,6 +15,6 @@
CFBundleSignature
????
CFBundleVersion
- 4.71
+ 4.72
diff --git a/mac_build/ScreenSaver-Info.plist b/mac_build/ScreenSaver-Info.plist
index 7e5cb8a4bc..0d45518917 100644
--- a/mac_build/ScreenSaver-Info.plist
+++ b/mac_build/ScreenSaver-Info.plist
@@ -17,7 +17,7 @@
CFBundleSignature
????
CFBundleVersion
- 4.71
+ 4.72
NSPrincipalClass
BOINC_Saver_ModuleView
diff --git a/mac_build/SystemMenu-Info.plist b/mac_build/SystemMenu-Info.plist
index 785a9cc0e9..abb7f7a441 100644
--- a/mac_build/SystemMenu-Info.plist
+++ b/mac_build/SystemMenu-Info.plist
@@ -15,6 +15,6 @@
CFBundleSignature
????
CFBundleVersion
- 4.71
+ 4.72
diff --git a/mac_installer/PostInstall.cpp b/mac_installer/PostInstall.cpp
index e1c474f07f..b5b1dab79a 100755
--- a/mac_installer/PostInstall.cpp
+++ b/mac_installer/PostInstall.cpp
@@ -34,7 +34,7 @@
void Initialize(void); /* function prototypes */
void SetUIDBackToUser (void);
OSErr FindProcess (OSType typeToFind, OSType creatorToFind, ProcessSerialNumberPtr processSN);
-pid_t FindProcessPID(pid_t thePID);
+pid_t FindProcessPID(char* name, pid_t thePID);
static OSErr QuitBOINCManager(OSType signature);
static OSErr QuitAppleEventHandler(const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon);
void print_to_log_file(const char *format, ...);
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
group *grp;
char s[256];
int NumberOfLoginItems, Counter, i;
- pid_t installerPID = 0;
+ pid_t installerPID = 0, coreClientPID = 0;
FSRef fileRef;
OSStatus err;
@@ -60,8 +60,13 @@ int main(int argc, char *argv[])
::GetCurrentProcess (&ourProcess);
- QuitBOINCManager('BNC!'); // Quit any old instance of BOINC
-
+ QuitBOINCManager('BNC!'); // Quit any old instance of BOINC manager
+ sleep(2);
+ // Core Client may still be running if it was started without Manager
+ coreClientPID = FindProcessPID("boinc", 0);
+ if (coreClientPID)
+ kill(coreClientPID, SIGTERM); // boinc catches SIGTERM & exits gracefully
+
err = FindProcess ('APPL', 'xins', &installerPSN);
if (err == noErr)
err = GetProcessPID(&installerPSN , &installerPID);
@@ -160,7 +165,7 @@ int main(int argc, char *argv[])
for (i=0; i<15; i++) { // Wait 15 seconds max for installer to quit
sleep (1);
- if (FindProcessPID(installerPID) == 0)
+ if (FindProcessPID(NULL, installerPID) == 0)
break;
}
@@ -228,21 +233,35 @@ OSErr FindProcess (OSType typeToFind, OSType creatorToFind, ProcessSerialNumberP
}
-pid_t FindProcessPID(pid_t thePID)
+pid_t FindProcessPID(char* name, pid_t thePID)
{
FILE *f;
char buf[1024];
+ size_t n = 0;
pid_t aPID;
-
+
+ if (name != NULL) // Search ny name
+ n = strlen(name);
+
f = popen("ps -a -x -c -o command,pid", "r");
if (f == NULL)
return 0;
- while (fgets(buf, sizeof(buf), f)) {
- aPID = atol(buf+16);
- if (aPID == thePID) {
- pclose(f);
- return aPID;
+ while (fgets(buf, sizeof(buf), f))
+ {
+ if (name != NULL) { // Search ny name
+ if (strncmp(buf, name, n) == 0)
+ {
+ aPID = atol(buf+16);
+ pclose(f);
+ return aPID;
+ }
+ } else { // Search by PID
+ aPID = atol(buf+16);
+ if (aPID == thePID) {
+ pclose(f);
+ return aPID;
+ }
}
}
pclose(f);