Add: Auto-Updater fuer Electron App

- Server: /updates Endpoint fuer Squirrel.Windows Update-Feed
- Electron: autoUpdater mit 30min Check-Intervall
- Preload: IPC-Events fuer Update-Status ans Frontend

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel 2026-03-07 13:45:27 +01:00
parent c8799710ac
commit 5eab3c1956
3 changed files with 59 additions and 3 deletions

View file

@ -1,5 +1,6 @@
import express from 'express';
import path from 'node:path';
import { readFile } from 'node:fs/promises';
import http from 'node:http';
import { WebSocketServer } from 'ws';
import { Client } from 'discord.js';
@ -154,6 +155,18 @@ async function boot(): Promise<void> {
}
}
// Squirrel.Windows auto-update feed
app.get('/updates', async (_req, res) => {
try {
const releasesPath = path.join(DATA_DIR, 'downloads', 'RELEASES');
const data = await readFile(releasesPath, 'utf-8');
res.set('Content-Type', 'application/octet-stream');
res.send(data);
} catch {
res.status(204).end();
}
});
// Serve download files (Electron installer etc.)
const downloadsDir = path.join(DATA_DIR, 'downloads');
app.use('/downloads', express.static(downloadsDir));