This commit is contained in:
2025-03-12 00:48:44 +08:00
parent 530d675985
commit b6e0b142d8
16 changed files with 33871 additions and 52 deletions

View File

@@ -7,7 +7,8 @@ import { loadMenu } from './menu/index.ts';
import { getLogPath, log } from './app.ts';
import { checkShowPage } from './window/page/index.ts';
import { closeProcess, createProcess } from './process/index.ts';
import { getElectronResourcePath } from './system/env.ts';
import { getElectronResourcePath, isMac } from './system/env.ts';
import { checkForUpdates } from './updater/index.ts';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -39,6 +40,9 @@ async function createWindow() {
app.on('ready', async () => {
await createProcess();
createWindow();
if (!isMac()) {
checkForUpdates();
}
});
app.on('window-all-closed', () => {

View File

@@ -1,6 +1,6 @@
import { createEnterPage } from '../window/page/enter.ts';
import { BrowserWindow, Menu, app } from 'electron';
import { shell } from 'electron';
import path from 'path';
import { getLogPath, log } from '../logger.ts';
import { createAppPackagesPage } from '../window/page/app-packages.ts';
@@ -125,7 +125,6 @@ export const loadMenu = () => {
{
label: '打开日志',
click: async () => {
const { shell } = require('electron');
log.transports.file.fileName;
shell.openExternal('file://' + path.join(getLogPath()));
},

10
src/main/updater/index.ts Normal file
View File

@@ -0,0 +1,10 @@
import { autoUpdater } from 'electron-updater';
autoUpdater.setFeedURL({
provider: 'generic',
url: 'https://kevisual.silkyai.cn/root/silky-assistant/',
});
export const checkForUpdates = () => {
autoUpdater.checkForUpdatesAndNotify();
};