@@ -384,27 +384,27 @@ int main(int argc, char *argv[])
384384 for (i=0 ; i<RETRY_LIMIT ; ++i) {
385385 err = CreateBOINCUsersAndGroups ();
386386 if (err != noErr) {
387- printf (" CreateBOINCUsersAndGroups returned %d (repetition=%d)" , err, i);
387+ printf (" CreateBOINCUsersAndGroups returned %d (repetition=%d)\n " , err, i);
388388 fflush (stdout);
389- REPORT_ERROR (i >= RETRY_LIMIT );
389+ REPORT_ERROR (i >= RETRY_LIMIT - 1 );
390390 continue ;
391391 }
392392
393393 // err = SetBOINCAppOwnersGroupsAndPermissions("/Applications/GridRepublic Desktop.app");
394394 err = SetBOINCAppOwnersGroupsAndPermissions (appPath[brandID]);
395395
396396 if (err != noErr) {
397- printf (" SetBOINCAppOwnersGroupsAndPermissions returned %d (repetition=%d)" , err, i);
397+ printf (" SetBOINCAppOwnersGroupsAndPermissions returned %d (repetition=%d)\n " , err, i);
398398 fflush (stdout);
399- REPORT_ERROR (i >= RETRY_LIMIT );
399+ REPORT_ERROR (i >= RETRY_LIMIT - 1 );
400400 continue ;
401401 }
402402
403403 err = SetBOINCDataOwnersGroupsAndPermissions ();
404404 if (err != noErr) {
405- printf (" SetBOINCDataOwnersGroupsAndPermissions returned %d (repetition=%d)" , err, i);
405+ printf (" SetBOINCDataOwnersGroupsAndPermissions returned %d (repetition=%d)\n " , err, i);
406406 fflush (stdout);
407- REPORT_ERROR (i >= RETRY_LIMIT );
407+ REPORT_ERROR (i >= RETRY_LIMIT - 1 );
408408 continue ;
409409 }
410410
@@ -414,14 +414,23 @@ int main(int argc, char *argv[])
414414 true , false , NULL , 0
415415 );
416416 if (err != noErr) {
417- printf (" check_security returned %d (repetition=%d)" , err, i);
417+ printf (" check_security returned %d (repetition=%d)\n " , err, i);
418418 fflush (stdout);
419- REPORT_ERROR (i >= RETRY_LIMIT );
419+ REPORT_ERROR (i >= RETRY_LIMIT - 1 );
420420 } else {
421421 break ;
422422 }
423423 }
424424
425+ // If security setup failed after all retries, report failure to the
426+ // macOS Installer so it does not show "Installation Successful" when
427+ // permissions were never set correctly.
428+ if (err != noErr) {
429+ printf (" BOINC security setup failed after %d attempts (last error=%d)\n " , RETRY_LIMIT , err);
430+ fflush (stdout);
431+ return err;
432+ }
433+
425434#else // ! defined(SANDBOX)
426435
427436 Boolean Success = false ;
0 commit comments