Mac installer: don't offer to set BOINC as screensaver when running under MacOS 14 Sonoma

This commit is contained in:
Charlie Fenton 2023-10-28 05:55:06 -07:00
parent cc2168ce6f
commit eb0231248c
1 changed files with 26 additions and 11 deletions

View File

@ -1678,19 +1678,27 @@ OSErr UpdateAllVisibleUsers(long brandID, long oldBrandID)
}
}
if (! saverAlreadySetForAll) {
if (gCommandLineInstall) {
err = stat("/tmp/setboincsaver.txt", &sbuf);
if (err == noErr) {
puts("setboincsaver.txt file detected\n");
fflush(stdout);
unlink("/tmp/setboincsaver.txt");
setSaverForAllUsers = true;
}
} else {
setSaverForAllUsers = ShowMessage(true,
// As of MacOS 14.0, the legacyScreenSaver sandbox prevents using
// IOSurfaceLookupFromMachPort. I have filed bug report FB13300491
// with Apple and hope they will change this in a future MacOS.
// Also as of MacOS 14.0 Sonoma, we can't set the screensaver
//automatically. I have filed bug report FB13270885 about this.
// See a;so the comment at top of SetScreenSaverSelection().
if (compareOSVersionTo(14, 0) < 0) {
if (! saverAlreadySetForAll) {
if (gCommandLineInstall) {
err = stat("/tmp/setboincsaver.txt", &sbuf);
if (err == noErr) {
puts("setboincsaver.txt file detected\n");
fflush(stdout);
unlink("/tmp/setboincsaver.txt");
setSaverForAllUsers = true;
}
} else {
setSaverForAllUsers = ShowMessage(true,
(char *)_("Do you want to set %s as the screensaver for all %s users on this Mac?"),
brandName[brandID], brandName[brandID]);
}
}
}
@ -2008,6 +2016,8 @@ OSErr UpdateAllVisibleUsers(long brandID, long oldBrandID)
}
// As of MacOS 14.0 Sonoma, this code no longer will detect the current screensaver,
// and will need to be rewritten. See the comment at top of SetScreenSaverSelection().
OSErr GetCurrentScreenSaverSelection(passwd *pw, char *moduleName, size_t maxLen) {
char buf[1024];
FILE *f;
@ -2047,6 +2057,11 @@ OSErr GetCurrentScreenSaverSelection(passwd *pw, char *moduleName, size_t maxLen
}
// As of MacOS 14.0 Sonoma, we can't set the screensaver automatically.
// I have filed bug report FB13270885 about this. After this is fixed,
// probably need to put an AppleScript to do this in the launch agent
// we add for each user. See also:
// https://forum.iscreensaver.com/t/understanding-the-macos-sonoma-screensaver-plist/718
OSErr SetScreenSaverSelection(char *moduleName, char *modulePath, int type) {
OSErr err = noErr;
CFStringRef preferenceName = CFSTR("com.apple.screensaver");