Use SquirrelMacEnableDirectContentsWrite on macOS

This commit is contained in:
Fedor Indutny 2023-01-23 17:09:09 -08:00 committed by GitHub
parent dba2a6b166
commit e8ed8b3400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,7 +94,7 @@ import type { MenuActionType } from '../ts/types/menu';
import { createTemplate } from './menu';
import { installFileHandler, installWebHandler } from './protocol_filter';
import * as OS from '../ts/OS';
import { isProduction } from '../ts/util/version';
import { isBeta, isProduction } from '../ts/util/version';
import {
isSgnlHref,
isCaptchaHref,
@ -120,6 +120,18 @@ import type { LoggerType } from '../ts/types/Logging';
const animationSettings = systemPreferences.getAnimationSettings();
if (
OS.isMacOS() &&
!isProduction(app.getVersion()) &&
!isBeta(app.getVersion())
) {
systemPreferences.setUserDefault(
'SquirrelMacEnableDirectContentsWrite',
'boolean',
true
);
}
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow: BrowserWindow | undefined;