Skip to content

Commit

Permalink
Merge pull request #276 from Totemancer/patch-1
Browse files Browse the repository at this point in the history
autoUpdater Improvements
  • Loading branch information
KuznetsovNikita authored Oct 9, 2024
2 parents 556b7d6 + c0a79bb commit 0b7e0e4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/desktop/src/electron/autoUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { autoUpdater, BrowserWindow, webContents } from 'electron';
import { app, autoUpdater, BrowserWindow, webContents } from 'electron';

export default class AppUpdate {
constructor() {
Expand All @@ -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);
});
Expand All @@ -22,10 +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 feedURL = 'https://update.electronjs.org/tonkeeper/tonkeeper-web/darwin-arm64/3.17.2';
// Build the feed URL
const feedURL = `https://update.electronjs.org/tonkeeper/tonkeeper-web/${platform}-${arch}/${appVersion}`;

autoUpdater.setFeedURL({ url: feedURL });
}
Expand Down

0 comments on commit 0b7e0e4

Please sign in to comment.