From 44e03dd00f013730708873888d59788514e91dc3 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 2 May 2021 11:30:59 +0200 Subject: [PATCH] Fixed the linux updater --- modules/core/app-updater/index.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/core/app-updater/index.ts b/modules/core/app-updater/index.ts index 15b7d66..3d46640 100644 --- a/modules/core/app-updater/index.ts +++ b/modules/core/app-updater/index.ts @@ -655,6 +655,7 @@ export async function availableClientUpdate() : Promise void, callbackAbort: () => void }> { @@ -715,14 +716,19 @@ export async function prepareUpdateExecute(targetVersion: UpdateVersion, callbac //We have to unpack it later executeCallback = () => { if(inaccessiblePaths.length > 0) { - dialog.showMessageBoxSync({ - buttons: [ "Ok" ], - title: "Update available", - message: - "We don't have permissions to write to all files.\n" + - "Please execute the following command to execute the update:\n" + - `sudo "${updateInstallerExecutable}" "${installLogFile}" "${installConfigFile}"` - }); + const updateCommand = `sudo "${updateInstallerExecutable}" "${installLogFile}" "${installConfigFile}"`; + try { + electron.clipboard.writeText(updateCommand); + } catch (error) { + console.error("Failed to copy command to clipboard: %o", error); + } + + callbackLog("error", + "We don't have permissions to write to all files.\n" + + "Please close this client and execute the following command:\n" + + `sudo "${updateInstallerExecutable}" "${installLogFile}" "${installConfigFile}"` + "\n\n" + + "We've already copied that command to your clipboard." + ); return; }