From c0a79bb44154cd743a68f76048f0702c3fc3ac87 Mon Sep 17 00:00:00 2001 From: Totemancer Date: Wed, 9 Oct 2024 17:34:56 +0200 Subject: [PATCH] Update autoUpdate with arch, platform --- apps/desktop/src/electron/autoUpdate.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src/electron/autoUpdate.ts b/apps/desktop/src/electron/autoUpdate.ts index 0e7da35f2..ece9f464d 100644 --- a/apps/desktop/src/electron/autoUpdate.ts +++ b/apps/desktop/src/electron/autoUpdate.ts @@ -14,6 +14,11 @@ export default class AppUpdate { ); } ); + + const appVersion = app.getVersion(); // Get the app version dynamically + const platform = process.platform; // Get the platform dynamically (e.g., 'darwin', 'win32') + const arch = process.arch; // Get the architecture dynamically (e.g., 'arm64', 'x64') + autoUpdater.addListener('error', function (error) { console.log(error); }); @@ -22,11 +27,11 @@ export default class AppUpdate { }); autoUpdater.addListener('update-not-available', function (event: any) { - notify('Tonkeeper Pro is up to date', `Version 123`); //${releaseName}`); + notify('Tonkeeper Pro is up to date', `Version ${releaseName}`); }); - const appVersion = app.getVersion(); // Get the app version dynamically - const feedURL = `https://update.electronjs.org/tonkeeper/tonkeeper-web/darwin-arm64/${appVersion}`; + // Build the feed URL + const feedURL = `https://update.electronjs.org/tonkeeper/tonkeeper-web/${platform}-${arch}/${appVersion}`; autoUpdater.setFeedURL({ url: feedURL }); }