Compare commits

...

2 Commits

Author SHA1 Message Date
RiotRobot
15455ad4be v1.11.112 2025-09-16 12:26:45 +00:00
ElementRobot
87c22acaae [Backport staging] Handle unsupported macOS versions better (#2555)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2025-09-16 13:23:08 +01:00
8 changed files with 71 additions and 8 deletions

View File

@@ -1,3 +1,15 @@
Changes in [1.11.112](https://github.com/element-hq/element-desktop/releases/tag/v1.11.112) (2025-09-16)
========================================================================================================
Fix [CVE-2025-59161](https://www.cve.org/CVERecord?id=CVE-2025-59161) / [GHSA-m6c8-98f4-75rr](https://github.com/element-hq/element-web/security/advisories/GHSA-m6c8-98f4-75rr)
## This is the last release compatible with macOS Big Sur. It will not update further. Big Sur is End of Life for almost 2 years and the next version of Electron crashes upon startup on Big Sur.
## ✨ Features
* [Backport staging] Handle unsupported macOS versions better ([#2555](https://github.com/element-hq/element-desktop/pull/2555)). Contributed by @RiotRobot.
Changes in [1.11.111](https://github.com/element-hq/element-desktop/releases/tag/v1.11.111) (2025-09-10)
========================================================================================================
## ✨ Features

View File

@@ -3,7 +3,7 @@
"productName": "Element",
"main": "lib/electron-main.js",
"exports": "./lib/electron-main.js",
"version": "1.11.111",
"version": "1.11.112",
"description": "Element: the future of secure communication",
"author": {
"name": "Element",

View File

@@ -413,7 +413,6 @@ app.on("ready", async () => {
if (argv["update"] === false) {
console.log("Auto update disabled via command line flag");
} else if (global.vectorConfig["update_base_url"]) {
console.log(`Starting auto update with base URL: ${global.vectorConfig["update_base_url"]}`);
void updater.start(global.vectorConfig["update_base_url"]);
} else {
console.log("No update_base_url is defined: auto update is disabled");

View File

@@ -32,6 +32,11 @@
"speech_start_speaking": "Start Speaking",
"speech_stop_speaking": "Stop Speaking"
},
"eol": {
"no_more_updates": "You are running an unsupported version of macOS. Please upgrade to receive %(brand)s updates.",
"title": "System unsupported",
"warning": "You are running an unsupported version of macOS. Please upgrade to ensure %(brand)s keeps working."
},
"file_menu": {
"label": "File"
},

View File

@@ -218,3 +218,10 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
});
ipcMain.handle("getConfig", () => global.vectorConfig);
const initialisePromiseWithResolvers = Promise.withResolvers<void>();
export const initialisePromise = initialisePromiseWithResolvers.promise;
ipcMain.once("initialise", () => {
initialisePromiseWithResolvers.resolve();
});

View File

@@ -32,6 +32,7 @@ const CHANNELS = [
"userAccessToken",
"homeserverUrl",
"serverSupportedVersions",
"showToast",
];
contextBridge.exposeInMainWorld("electron", {
@@ -60,6 +61,7 @@ contextBridge.exposeInMainWorld("electron", {
*/
supportsBadgeOverlay: boolean;
}> {
ipcRenderer.emit("initialise");
const [{ protocol, sessionId }, config, supportedSettings] = await Promise.all([
ipcRenderer.invoke("getProtocol"),
ipcRenderer.invoke("getConfig"),

View File

@@ -7,8 +7,11 @@ Please see LICENSE files in the repository root for full details.
import { app, autoUpdater, ipcMain } from "electron";
import fs from "node:fs/promises";
import os from "node:os";
import { getSquirrelExecutable } from "./squirrelhooks.js";
import { _t } from "./language-helper.js";
import { initialisePromise } from "./ipc.js";
const UPDATE_POLL_INTERVAL_MS = 60 * 60 * 1000;
const INITIAL_UPDATE_DELAY_MS = 30 * 1000;
@@ -69,7 +72,8 @@ async function pollForUpdates(): Promise<void> {
}
export async function start(updateBaseUrl: string): Promise<void> {
if (!(await available(updateBaseUrl))) return;
if (!(await available())) return;
console.log(`Starting auto update with base URL: ${updateBaseUrl}`);
if (!updateBaseUrl.endsWith("/")) {
updateBaseUrl = updateBaseUrl + "/";
}
@@ -111,10 +115,15 @@ export async function start(updateBaseUrl: string): Promise<void> {
}
}
async function available(updateBaseUrl?: string): Promise<boolean> {
/**
* Check if auto update is available on this platform.
* Has a side effect of firing showToast on EOL platforms so must only be called once!
* @returns True if auto update is available
*/
async function available(): Promise<boolean> {
if (process.platform === "linux") {
// Auto update is not supported on Linux
console.log("Auto update not supported on this platform");
console.warn("Auto update not supported on this platform");
return false;
}
@@ -122,13 +131,42 @@ async function available(updateBaseUrl?: string): Promise<boolean> {
try {
await fs.access(getSquirrelExecutable());
} catch {
console.log("Squirrel not found, auto update not supported");
console.warn("Squirrel not found, auto update not supported");
return false;
}
}
// Otherwise we're either on macOS or Windows with Squirrel
return !!updateBaseUrl;
if (process.platform === "darwin") {
// OS release returns the Darwin kernel version, not the macOS version, see
// https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history to interpret it
const release = os.release();
const major = parseInt(release.split(".")[0], 10);
if (major < 21) {
// If the macOS version is too old for modern Electron support then disable auto update to prevent the app updating and bricking itself.
// The oldest macOS version supported by Chromium/Electron 38 is Monterey (12.x) which started with Darwin 21.0
initialisePromise.then(() => {
ipcMain.emit("showToast", {
title: _t("eol|title"),
description: _t("eol|no_more_updates", { brand: global.trayConfig.brand }),
});
});
console.warn("Auto update not supported, macOS version too old");
return false;
} else if (major < 22) {
// If the macOS version is EOL then show a warning message.
// The oldest macOS version still supported by Apple is Ventura (13.x) which started with Darwin 22.0
initialisePromise.then(() => {
ipcMain.emit("showToast", {
title: _t("eol|title"),
description: _t("eol|warning", { brand: global.trayConfig.brand }),
});
});
}
}
return true;
}
ipcMain.on("install_update", installUpdate);

View File

@@ -11,7 +11,7 @@
"rootDir": "./src",
"declaration": true,
"typeRoots": ["src/@types", "node_modules/@types"],
"lib": ["es2022"],
"lib": ["es2022", "es2024.promise"],
"types": ["node"],
"strict": true
},