Update auto updater config (#514)

* update autoupdater config

* update deps

* update window size
This commit is contained in:
an-lee
2024-04-12 09:29:40 +08:00
committed by GitHub
parent 39c55b5f3f
commit 1c3b148e9a
11 changed files with 769 additions and 541 deletions

View File

@@ -3,12 +3,16 @@ import path from "path";
import fs from "fs-extra";
import settings from "@main/settings";
import "@main/i18n";
import log from "@main/logger";
import mainWindow from "@main/window";
import ElectronSquirrelStartup from "electron-squirrel-startup";
import contextMenu from "electron-context-menu";
import { t } from "i18next";
import * as Sentry from "@sentry/electron";
import { SENTRY_DSN } from "@/constants";
import { updateElectronApp, UpdateSourceType } from "update-electron-app";
const logger = log.scope("main");
Sentry.init({
dsn: SENTRY_DSN,
@@ -16,6 +20,17 @@ Sentry.init({
app.commandLine.appendSwitch("enable-features", "SharedArrayBuffer");
// config auto updater
updateElectronApp({
updateSource: {
type: UpdateSourceType.StaticStorage,
baseUrl: `https://dl.enjoy.bot/app/${process.platform}/${process.arch}`,
},
updateInterval: "1 hour",
logger: logger,
notifyUser: true,
});
// Add context menu
contextMenu({
showSearchWithGoogle: false,