Skip to content

Commit

Permalink
Update autoUpdate with arch, platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Totemancer authored Oct 9, 2024
1 parent ef31d27 commit c0a79bb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/desktop/src/electron/autoUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,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 });
}
Expand Down

0 comments on commit c0a79bb

Please sign in to comment.