update
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
@@ -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
10
src/main/updater/index.ts
Normal 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();
|
||||
};
|
||||
Reference in New Issue
Block a user