Update auto updater config (#514)
* update autoupdater config * update deps * update window size
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
"markdown-it-sub": "^2.0.0",
|
"markdown-it-sub": "^2.0.0",
|
||||||
"markdown-it-sup": "^2.0.0",
|
"markdown-it-sup": "^2.0.0",
|
||||||
"mermaid": "^10.9.0",
|
"mermaid": "^10.9.0",
|
||||||
"sass": "^1.74.1",
|
"sass": "^1.75.0",
|
||||||
"vitepress": "^1.0.2",
|
"vitepress": "^1.1.0",
|
||||||
"vitepress-plugin-mermaid": "^2.0.16",
|
"vitepress-plugin-mermaid": "^2.0.16",
|
||||||
"vue": "^3.4.21"
|
"vue": "^3.4.21"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ const config = {
|
|||||||
name: "Enjoy",
|
name: "Enjoy",
|
||||||
setupIcon: "./assets/icon.ico",
|
setupIcon: "./assets/icon.ico",
|
||||||
config: (arch) => ({
|
config: (arch) => ({
|
||||||
remoteReleases: `https://dl.enjoy.bot/enjoy-updates/win32/${arch}`,
|
remoteReleases: `https://dl.enjoy.bot/app/win32/${arch}`,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
new MakerZIP({
|
new MakerZIP({
|
||||||
config: (arch) => ({
|
config: (arch) => ({
|
||||||
macUpdateManifestBaseUrl: `https://dl.enjoy.bot/enjoy-updates/darwin/${arch}`,
|
macUpdateManifestBaseUrl: `https://dl.enjoy.bot/app/darwin/${arch}`,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
new MakerDeb({
|
new MakerDeb({
|
||||||
@@ -155,6 +155,7 @@ if (
|
|||||||
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
|
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
|
||||||
endpoint: process.env.S3_ENDPOINT,
|
endpoint: process.env.S3_ENDPOINT,
|
||||||
bucket: "download",
|
bucket: "download",
|
||||||
|
folder: "app",
|
||||||
region: "auto",
|
region: "auto",
|
||||||
public: true,
|
public: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,16 +30,16 @@
|
|||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@electron-forge/cli": "^7.3.1",
|
"@electron-forge/cli": "^7.4.0",
|
||||||
"@electron-forge/maker-deb": "^7.3.1",
|
"@electron-forge/maker-deb": "^7.4.0",
|
||||||
"@electron-forge/maker-dmg": "^7.3.1",
|
"@electron-forge/maker-dmg": "^7.4.0",
|
||||||
"@electron-forge/maker-rpm": "^7.3.1",
|
"@electron-forge/maker-rpm": "^7.4.0",
|
||||||
"@electron-forge/maker-squirrel": "^7.3.1",
|
"@electron-forge/maker-squirrel": "^7.4.0",
|
||||||
"@electron-forge/maker-zip": "^7.3.1",
|
"@electron-forge/maker-zip": "^7.4.0",
|
||||||
"@electron-forge/plugin-auto-unpack-natives": "^7.3.1",
|
"@electron-forge/plugin-auto-unpack-natives": "^7.4.0",
|
||||||
"@electron-forge/plugin-fuses": "^7.3.1",
|
"@electron-forge/plugin-fuses": "^7.4.0",
|
||||||
"@electron-forge/plugin-vite": "^7.3.1",
|
"@electron-forge/plugin-vite": "^7.4.0",
|
||||||
"@electron-forge/publisher-github": "^7.3.1",
|
"@electron-forge/publisher-github": "^7.4.0",
|
||||||
"@electron/fuses": "^1.8.0",
|
"@electron/fuses": "^1.8.0",
|
||||||
"@playwright/test": "^1.43.0",
|
"@playwright/test": "^1.43.0",
|
||||||
"@tailwindcss/typography": "^0.5.12",
|
"@tailwindcss/typography": "^0.5.12",
|
||||||
@@ -51,16 +51,16 @@
|
|||||||
"@types/intl-tel-input": "^18.1.4",
|
"@types/intl-tel-input": "^18.1.4",
|
||||||
"@types/lodash": "^4.17.0",
|
"@types/lodash": "^4.17.0",
|
||||||
"@types/mark.js": "^8.11.12",
|
"@types/mark.js": "^8.11.12",
|
||||||
"@types/node": "^20.12.5",
|
"@types/node": "^20.12.7",
|
||||||
"@types/react": "^18.2.75",
|
"@types/react": "^18.2.77",
|
||||||
"@types/react-dom": "^18.2.24",
|
"@types/react-dom": "^18.2.25",
|
||||||
"@types/validator": "^13.11.9",
|
"@types/validator": "^13.11.9",
|
||||||
"@types/wavesurfer.js": "^6.0.12",
|
"@types/wavesurfer.js": "^6.0.12",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
||||||
"@typescript-eslint/parser": "^7.6.0",
|
"@typescript-eslint/parser": "^7.6.0",
|
||||||
"@vitejs/plugin-react": "^4.2.1",
|
"@vitejs/plugin-react": "^4.2.1",
|
||||||
"autoprefixer": "^10.4.19",
|
"autoprefixer": "^10.4.19",
|
||||||
"electron": "^29.2.0",
|
"electron": "^29.3.0",
|
||||||
"electron-playwright-helpers": "^1.7.1",
|
"electron-playwright-helpers": "^1.7.1",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-import-resolver-typescript": "^3.6.1",
|
"eslint-import-resolver-typescript": "^3.6.1",
|
||||||
@@ -74,17 +74,17 @@
|
|||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"tslib": "^2.6.2",
|
"tslib": "^2.6.2",
|
||||||
"typescript": "^5.4.4",
|
"typescript": "^5.4.5",
|
||||||
"vite": "^5.2.8",
|
"vite": "^5.2.8",
|
||||||
"vite-plugin-static-copy": "^1.0.2",
|
"vite-plugin-static-copy": "^1.0.2",
|
||||||
"zx": "^8.0.1"
|
"zx": "^8.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@andrkrn/ffprobe-static": "^5.2.0",
|
"@andrkrn/ffprobe-static": "^5.2.0",
|
||||||
"@electron-forge/publisher-s3": "^7.3.1",
|
"@electron-forge/publisher-s3": "^7.4.0",
|
||||||
"@hookform/resolvers": "^3.3.4",
|
"@hookform/resolvers": "^3.3.4",
|
||||||
"@langchain/community": "^0.0.43",
|
"@langchain/community": "^0.0.43",
|
||||||
"@langchain/google-genai": "^0.0.10",
|
"@langchain/google-genai": "^0.0.11",
|
||||||
"@mozilla/readability": "^0.5.0",
|
"@mozilla/readability": "^0.5.0",
|
||||||
"@radix-ui/react-accordion": "^1.1.2",
|
"@radix-ui/react-accordion": "^1.1.2",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
"@sentry/electron": "^4.22.0",
|
"@sentry/electron": "^4.22.0",
|
||||||
"@types/ahoy.js": "^0.4.2",
|
"@types/ahoy.js": "^0.4.2",
|
||||||
"@uidotdev/usehooks": "^2.4.1",
|
"@uidotdev/usehooks": "^2.4.1",
|
||||||
"@vidstack/react": "^1.11.13",
|
"@vidstack/react": "^1.11.17",
|
||||||
"ahoy.js": "^0.4.4",
|
"ahoy.js": "^0.4.4",
|
||||||
"autosize": "^6.0.1",
|
"autosize": "^6.0.1",
|
||||||
"axios": "^1.6.8",
|
"axios": "^1.6.8",
|
||||||
@@ -132,19 +132,19 @@
|
|||||||
"echogarden": "^0.12.2",
|
"echogarden": "^0.12.2",
|
||||||
"electron-context-menu": "^3.6.1",
|
"electron-context-menu": "^3.6.1",
|
||||||
"electron-log": "^5.1.2",
|
"electron-log": "^5.1.2",
|
||||||
"electron-settings": "^4.0.2",
|
"electron-settings": "^4.0.3",
|
||||||
"electron-squirrel-startup": "^1.0.0",
|
"electron-squirrel-startup": "^1.0.0",
|
||||||
"ffmpeg-static": "^5.2.0",
|
"ffmpeg-static": "^5.2.0",
|
||||||
"fluent-ffmpeg": "^2.1.2",
|
"fluent-ffmpeg": "^2.1.2",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"html-to-text": "^9.0.5",
|
"html-to-text": "^9.0.5",
|
||||||
"https-proxy-agent": "^7.0.4",
|
"https-proxy-agent": "^7.0.4",
|
||||||
"i18next": "^23.11.0",
|
"i18next": "^23.11.1",
|
||||||
"intl-tel-input": "^21.1.1",
|
"intl-tel-input": "^21.1.3",
|
||||||
"js-md5": "^0.8.3",
|
"js-md5": "^0.8.3",
|
||||||
"langchain": "^0.1.31",
|
"langchain": "^0.1.33",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"lucide-react": "^0.365.0",
|
"lucide-react": "^0.367.0",
|
||||||
"mark.js": "^8.11.1",
|
"mark.js": "^8.11.1",
|
||||||
"microsoft-cognitiveservices-speech-sdk": "^1.36.0",
|
"microsoft-cognitiveservices-speech-sdk": "^1.36.0",
|
||||||
"next-themes": "^0.3.0",
|
"next-themes": "^0.3.0",
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-activity-calendar": "^2.2.8",
|
"react-activity-calendar": "^2.2.8",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-hook-form": "^7.51.2",
|
"react-hook-form": "^7.51.3",
|
||||||
"react-hotkeys-hook": "^4.5.0",
|
"react-hotkeys-hook": "^4.5.0",
|
||||||
"react-i18next": "^14.1.0",
|
"react-i18next": "^14.1.0",
|
||||||
"react-markdown": "^9.0.1",
|
"react-markdown": "^9.0.1",
|
||||||
|
|||||||
@@ -262,6 +262,10 @@
|
|||||||
"currentVersion": "Current version",
|
"currentVersion": "Current version",
|
||||||
"checkUpdate": "Check update",
|
"checkUpdate": "Check update",
|
||||||
"checkingLatestVersion": "Checking latest version",
|
"checkingLatestVersion": "Checking latest version",
|
||||||
|
"updateAvailable": "Update available",
|
||||||
|
"updateDownloaded": "A new version has been downloaded. Restart the application to apply the updates.",
|
||||||
|
"restart": "Restart",
|
||||||
|
"later": "Later",
|
||||||
"userGuide": "User guide",
|
"userGuide": "User guide",
|
||||||
"feedback": "Feedback",
|
"feedback": "Feedback",
|
||||||
"alreadyLatestVersion": "Already latest version",
|
"alreadyLatestVersion": "Already latest version",
|
||||||
|
|||||||
@@ -262,6 +262,10 @@
|
|||||||
"currentVersion": "当前版本",
|
"currentVersion": "当前版本",
|
||||||
"checkUpdate": "检查更新",
|
"checkUpdate": "检查更新",
|
||||||
"checkingLatestVersion": "正在检查最新版本",
|
"checkingLatestVersion": "正在检查最新版本",
|
||||||
|
"updateAvailable": "有新版本可用",
|
||||||
|
"updateDownloaded": "新版本已下载,点击重新启动以更新",
|
||||||
|
"restart": "Restart",
|
||||||
|
"later": "Later",
|
||||||
"userGuide": "用户指南",
|
"userGuide": "用户指南",
|
||||||
"feedback": "反馈",
|
"feedback": "反馈",
|
||||||
"alreadyLatestVersion": "已经是最新版本",
|
"alreadyLatestVersion": "已经是最新版本",
|
||||||
|
|||||||
@@ -3,12 +3,16 @@ import path from "path";
|
|||||||
import fs from "fs-extra";
|
import fs from "fs-extra";
|
||||||
import settings from "@main/settings";
|
import settings from "@main/settings";
|
||||||
import "@main/i18n";
|
import "@main/i18n";
|
||||||
|
import log from "@main/logger";
|
||||||
import mainWindow from "@main/window";
|
import mainWindow from "@main/window";
|
||||||
import ElectronSquirrelStartup from "electron-squirrel-startup";
|
import ElectronSquirrelStartup from "electron-squirrel-startup";
|
||||||
import contextMenu from "electron-context-menu";
|
import contextMenu from "electron-context-menu";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import * as Sentry from "@sentry/electron";
|
import * as Sentry from "@sentry/electron";
|
||||||
import { SENTRY_DSN } from "@/constants";
|
import { SENTRY_DSN } from "@/constants";
|
||||||
|
import { updateElectronApp, UpdateSourceType } from "update-electron-app";
|
||||||
|
|
||||||
|
const logger = log.scope("main");
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
dsn: SENTRY_DSN,
|
dsn: SENTRY_DSN,
|
||||||
@@ -16,6 +20,17 @@ Sentry.init({
|
|||||||
|
|
||||||
app.commandLine.appendSwitch("enable-features", "SharedArrayBuffer");
|
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
|
// Add context menu
|
||||||
contextMenu({
|
contextMenu({
|
||||||
showSearchWithGoogle: false,
|
showSearchWithGoogle: false,
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import { Waveform } from "./waveform";
|
|||||||
import url from "url";
|
import url from "url";
|
||||||
import echogarden from "./echogarden";
|
import echogarden from "./echogarden";
|
||||||
import camdict from "./camdict";
|
import camdict from "./camdict";
|
||||||
import { updateElectronApp, UpdateSourceType } from "update-electron-app";
|
|
||||||
|
|
||||||
const __filename = url.fileURLToPath(import.meta.url);
|
const __filename = url.fileURLToPath(import.meta.url);
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename);
|
||||||
@@ -387,15 +386,6 @@ ${log}
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.handle("app-update", () => {
|
|
||||||
return updateElectronApp({
|
|
||||||
updateSource: {
|
|
||||||
type: UpdateSourceType.StaticStorage,
|
|
||||||
baseUrl: `https://dl.enjoy.bot/enjoy-updates/${process.platform}/${process.arch}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
ipcMain.handle(
|
ipcMain.handle(
|
||||||
"system-preferences-media-access",
|
"system-preferences-media-access",
|
||||||
async (_event, mediaType: "microphone" | "camera") => {
|
async (_event, mediaType: "microphone" | "camera") => {
|
||||||
@@ -456,8 +446,8 @@ ${log}
|
|||||||
icon: "./assets/icon.png",
|
icon: "./assets/icon.png",
|
||||||
width: 1280,
|
width: 1280,
|
||||||
height: 720,
|
height: 720,
|
||||||
minWidth: 720,
|
minWidth: 800,
|
||||||
minHeight: 576,
|
minHeight: 600,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: path.join(__dirname, "preload.js"),
|
preload: path.join(__dirname, "preload.js"),
|
||||||
spellcheck: false,
|
spellcheck: false,
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ contextBridge.exposeInMainWorld("__ENJOY_APP__", {
|
|||||||
createIssue: (title: string, body: string) => {
|
createIssue: (title: string, body: string) => {
|
||||||
return ipcRenderer.invoke("app-create-issue", title, body);
|
return ipcRenderer.invoke("app-create-issue", title, body);
|
||||||
},
|
},
|
||||||
update: () => {
|
|
||||||
return ipcRenderer.invoke("app-update");
|
|
||||||
},
|
|
||||||
version,
|
version,
|
||||||
},
|
},
|
||||||
window: {
|
window: {
|
||||||
|
|||||||
@@ -7,15 +7,7 @@ export const About = () => {
|
|||||||
const { version, EnjoyApp } = useContext(AppSettingsProviderContext);
|
const { version, EnjoyApp } = useContext(AppSettingsProviderContext);
|
||||||
|
|
||||||
const checkUpdate = async () => {
|
const checkUpdate = async () => {
|
||||||
toast.promise(
|
EnjoyApp.shell.openExternal("https://1000h.org/enjoy-app/install.html");
|
||||||
EnjoyApp.app.update().catch((error) => {
|
|
||||||
toast.error(error);
|
|
||||||
EnjoyApp.shell.openExternal("https://1000h.org/enjoy-app/install.html");
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
loading: t("checkingLatestVersion"),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
1
enjoy/src/types/enjoy-app.d.ts
vendored
1
enjoy/src/types/enjoy-app.d.ts
vendored
@@ -9,7 +9,6 @@ type EnjoyAppType = {
|
|||||||
quit: () => Promise<void>;
|
quit: () => Promise<void>;
|
||||||
openDevTools: () => Promise<void>;
|
openDevTools: () => Promise<void>;
|
||||||
createIssue: (title: string, body: string) => Promise<void>;
|
createIssue: (title: string, body: string) => Promise<void>;
|
||||||
update: () => Promise<void>;
|
|
||||||
version: string;
|
version: string;
|
||||||
};
|
};
|
||||||
window: {
|
window: {
|
||||||
|
|||||||
Reference in New Issue
Block a user