From a5731f9200e3f9502572778c1bc31d0d8ea06def Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 10 Mar 2014 03:30:26 -0700 Subject: [PATCH] Mac installer: fix automatic launching of Manager after installation on OS 10.5 --- mac_installer/PostInstall.cpp | 9 +++++++-- mac_installer/postinstall | 3 ++- mac_installer/postupgrade | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mac_installer/PostInstall.cpp b/mac_installer/PostInstall.cpp index 7ce5e01f8c..b449642663 100644 --- a/mac_installer/PostInstall.cpp +++ b/mac_installer/PostInstall.cpp @@ -547,7 +547,8 @@ int DeleteReceipt() Initialize(); restartNeeded = IsRestartNeeded(); -// print_to_log_file("IsRestartNeeded() returned %d\n", (int)restartNeeded); + printf("IsRestartNeeded() returned %d\n", (int)restartNeeded); + fflush(stdout); brandID = GetBrandID(); @@ -568,8 +569,9 @@ int DeleteReceipt() for (i=0; i<15; i++) { // Wait 15 seconds max for installer to quit sleep (1); if (err == noErr) - if (FindProcessPID(NULL, installerPID) == 0) + if (FindProcessPID(NULL, installerPID) == 0) { break; + } } } @@ -594,6 +596,9 @@ Boolean IsRestartNeeded() { int value; restartNeededFile = fopen("/tmp/BOINC_restart_flag", "r"); + if (!restartNeededFile) { + restartNeededFile = fopen("/private/tmp/BOINC_restart_flag", "r"); + } if (restartNeededFile) { fscanf(restartNeededFile,"%d", &value); fclose(restartNeededFile); diff --git a/mac_installer/postinstall b/mac_installer/postinstall index 38a6dc70af..00edbac09a 100755 --- a/mac_installer/postinstall +++ b/mac_installer/postinstall @@ -4,6 +4,7 @@ # post-Install Script for Macintosh BOINC Manager for OS X revised 12/6/10 ## +echo "Starting BOINC postinstall script" echo "initial directory = $PWD" echo "argument 1 = $1" @@ -22,7 +23,7 @@ sleep 2 else "/tmp/PostInstall.app/Contents/MacOS/PostInstall" -part1 sleep 2 -"/tmp/PostInstall.app/Contents/MacOS/PostInstall" -part2 >> stdout & +"/tmp/PostInstall.app/Contents/MacOS/PostInstall" -part2 & fi exit 0 diff --git a/mac_installer/postupgrade b/mac_installer/postupgrade index 3b917e56a4..182fc1c413 100755 --- a/mac_installer/postupgrade +++ b/mac_installer/postupgrade @@ -4,6 +4,7 @@ # post-Upgrade Script for Macintosh BOINC Manager for OS X revised 12/6/10 ## +echo "Starting BOINC postupgrade script" echo "initial directory = $PWD" echo "argument 1 = $1" @@ -22,7 +23,7 @@ sleep 2 else "/tmp/PostInstall.app/Contents/MacOS/PostInstall" -part1 sleep 2 -"/tmp/PostInstall.app/Contents/MacOS/PostInstall" -part >> stdout & +"/tmp/PostInstall.app/Contents/MacOS/PostInstall" -part2 & fi exit 0