mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: adding electron updater
This commit is contained in:
parent
125264ff42
commit
05cc2a1206
5 changed files with 36 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
import { app, BrowserWindow, net, protocol } from "electron";
|
||||
import updater from "electron-updater";
|
||||
import i18n from "i18next";
|
||||
import path from "node:path";
|
||||
import { electronApp, optimizer } from "@electron-toolkit/utils";
|
||||
|
@ -7,6 +8,14 @@ import { dataSource } from "@main/data-source";
|
|||
import * as resources from "@locales";
|
||||
import { userPreferencesRepository } from "@main/repository";
|
||||
|
||||
const { autoUpdater } = updater;
|
||||
|
||||
autoUpdater.setFeedURL({
|
||||
provider: "github",
|
||||
owner: "hydralauncher",
|
||||
repo: "hydra",
|
||||
});
|
||||
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
if (!gotTheLock) app.quit();
|
||||
|
||||
|
@ -52,6 +61,10 @@ app.whenReady().then(() => {
|
|||
|
||||
WindowManager.createMainWindow();
|
||||
WindowManager.createSystemTray(userPreferences?.language || "en");
|
||||
|
||||
WindowManager.mainWindow?.on("ready-to-show", () => {
|
||||
autoUpdater.checkForUpdatesAndNotify();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue