mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
Init AppImage support
This commit is contained in:
21
ts/util/relaunch.main.ts
Normal file
21
ts/util/relaunch.main.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user