Init AppImage support

This commit is contained in:
ayumi-signal
2025-11-19 12:00:37 -08:00
committed by GitHub
parent 7c12a1d3de
commit c6fa4c0c73
15 changed files with 182 additions and 12 deletions

21
ts/util/relaunch.main.ts Normal file
View File

@@ -0,0 +1,21 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { app } from 'electron';
import type { RelaunchOptions } from 'electron';
import OS from './os/osMain.node.js';
// app.relaunch() doesn't work in AppImage, so this is a workaround
export function appRelaunch(): void {
if (!OS.isAppImage()) {
app.relaunch();
return;
}
const options: RelaunchOptions = {
args: ['--appimage-extract-and-run', ...process.argv],
execPath: process.env.APPIMAGE,
};
app.relaunch(options);
}