From e2a98fe17e01ec9f104eaa76574a8e0933fed5ed Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Sun, 22 May 2005 11:12:16 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=6215 --- checkin_notes | 9 +++++++++ mac_installer/PostInstall.cpp | 38 ++++++++++++----------------------- mac_installer/postinstall | 2 +- mac_installer/postupgrade | 2 +- 4 files changed, 24 insertions(+), 27 deletions(-) diff --git a/checkin_notes b/checkin_notes index 8347a137a8..689b9c67c8 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6883,3 +6883,12 @@ Rom 21 May 2005 api/ windows_opengl.C + +Charlie 21 may 2005 + Fix problems launching BOINC Manager from installer. + + mac_installer/ + postinstall + postupgrade + PostInstall.cpp + diff --git a/mac_installer/PostInstall.cpp b/mac_installer/PostInstall.cpp index adfe38606d..c6249cd7e1 100755 --- a/mac_installer/PostInstall.cpp +++ b/mac_installer/PostInstall.cpp @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) long response; ProcessSerialNumber ourProcess, installerPSN; short itemHit; - int NumberOfLoginItems, Counter; + int NumberOfLoginItems, Counter, i; pid_t installerPID = 0; FSRef fileRef; OSStatus err; @@ -74,23 +74,17 @@ int main(int argc, char *argv[]) StandardAlert (kAlertStopAlert, "\pSorry, BOINC requires system 10.3 or higher.", NULL, NULL, &itemHit); + err = kill(installerPID, SIGKILL); + // Remove everything we've installed system ("rm -rf /Applications/BOINCManager.app"); system ("rm -rf /Library/Screen\\ Savers/BOINCSaver.saver"); system ("rm -rf /Library/Application\\ Support/BOINC\\ Data"); system ("rm -rf /Library/Receipts/BOINC.pkg"); - err = kill(installerPID, SIGKILL); ExitToShell(); } - err = FSPathMakeRef((StringPtr)"/Applications/BOINCManager.app", &fileRef, NULL); - if (err == noErr) - err = LSOpenFSRef(&fileRef, NULL); - -// ***************************************************************************************** -// Everything after this REQUIRES us to be setuid to the login user's user ID -// ***************************************************************************************** // Installer is running as root. We must setuid back to the logged in user // in order to add a startup item to the user's login preferences @@ -117,24 +111,18 @@ int main(int argc, char *argv[]) Success = AddLoginItemWithPropertiesToUser(kCurrentUser, "/Applications/BOINCManager.app", kDoNotHideOnLaunch); -#if 0 - int i; - pid_t myPid = 0; + // Launch BOINC Manager when user closes installer or after 15 seconds - // Fork a process to launch the BOINCManager after the installer quits - if ( (myPid = fork()) < 0) // error - return -1; - else if (myPid == 0) { // child - for (i=0; i<15; i++) { // Wait 15 seconds max for installer to quit - sleep (1); - if (FindProcessPID(installerPID) == 0) - break; - } - - system("/Applications/BOINCManager.app/Contents/MacOS/BOINCManager"); + for (i=0; i<15; i++) { // Wait 15 seconds max for installer to quit + sleep (1); + if (FindProcessPID(installerPID) == 0) + break; } - // We get here if parent (myPID > 0) -#endif + + err = FSPathMakeRef((StringPtr)"/Applications/BOINCManager.app", &fileRef, NULL); + if (err == noErr) + err = LSOpenFSRef(&fileRef, NULL); + return 0; } diff --git a/mac_installer/postinstall b/mac_installer/postinstall index 4c5f9a10f5..3903597156 100644 --- a/mac_installer/postinstall +++ b/mac_installer/postinstall @@ -8,4 +8,4 @@ chmod -R a+s /Applications/BOINCManager.app cd "$1" # Run the Postinstall Application -Contents/Resources/PostInstall.app/Contents/MacOS/PostInstall +Contents/Resources/PostInstall.app/Contents/MacOS/PostInstall & diff --git a/mac_installer/postupgrade b/mac_installer/postupgrade index d5d80c966f..08d1908581 100755 --- a/mac_installer/postupgrade +++ b/mac_installer/postupgrade @@ -8,4 +8,4 @@ chmod -R a+s /Applications/BOINCManager.app cd "$1" # Run the Postinstall Application -Contents/Resources/PostInstall.app/Contents/MacOS/PostInstall +Contents/Resources/PostInstall.app/Contents/MacOS/PostInstall &