Fix Electron update: Squirrel feed URL, version display, error details

- Fix: Squirrel.Windows feed URL /updates → /downloads (Squirrel appends /RELEASES)
- Show Desktop App + Server version in update modal
- Display actual error message in failed state
- Dynamic Electron version via app.getVersion() instead of hardcoded
- Sync electron/package.json version with VERSION file (1.5.8)
- Add "Später" button on update-ready, timeout error message
- Style: version info, error detail box, secondary button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel 2026-03-07 19:23:30 +01:00
parent 56ac2d0079
commit 9fd0992fc4
5 changed files with 66 additions and 10 deletions

View file

@ -10,11 +10,19 @@ try {
}
const HUB_URL = process.env.GAMING_HUB_URL || 'https://hub.daddelolymp.de';
const APP_VERSION = app.getVersion();
// Sync IPC: preload reads app version from package.json
ipcMain.on('get-app-version', (event) => {
event.returnValue = APP_VERSION;
});
function setupAutoUpdater() {
if (process.platform !== 'win32') return;
const updateURL = `${HUB_URL}/updates`;
// Squirrel.Windows appends /RELEASES to the feed URL,
// so point to /downloads where RELEASES + nupkg files live
const updateURL = `${HUB_URL}/downloads`;
try {
autoUpdater.setFeedURL({ url: updateURL });
} catch (e) {
@ -93,7 +101,7 @@ function createWindow() {
// Custom User-Agent to identify Electron app
const currentUA = mainWindow.webContents.getUserAgent();
mainWindow.webContents.setUserAgent(currentUA + ' GamingHubDesktop/1.5.0');
mainWindow.webContents.setUserAgent(currentUA + ` GamingHubDesktop/${APP_VERSION}`);
mainWindow.loadURL(HUB_URL);