diff --git a/packages/gui/src/background.js b/packages/gui/src/background.js index cd066d0..6ad0390 100644 --- a/packages/gui/src/background.js +++ b/packages/gui/src/background.js @@ -34,7 +34,7 @@ function setTray (app) { // 系统托盘图标目录 label: '退出', click: () => { - console.log('force quit') + log.info('force quit') forceClose = true quit(app) } @@ -100,7 +100,9 @@ function createWindow () { if (args.hideWindow) { startHideWindow = true } + log.info('start args', args) } + log.info('start hide window', startHideWindow) win = new BrowserWindow({ width: 900, @@ -194,7 +196,7 @@ if (!isFirstInstance) { // Quit when all windows are closed. app.on('window-all-closed', () => { - console.log('window-all-closed') + log.info('window-all-closed') // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { diff --git a/packages/gui/src/bridge/auto-start/backend.js b/packages/gui/src/bridge/auto-start/backend.js index 6d4e362..34c7eef 100644 --- a/packages/gui/src/bridge/auto-start/backend.js +++ b/packages/gui/src/bridge/auto-start/backend.js @@ -28,7 +28,7 @@ export default { install (context) { const { ipcMain, dialog, log, app } = context - const ex = process.execPath + const ex = app.getPath('exe') // 定义事件,渲染进程中直接使用 @@ -44,7 +44,7 @@ export default { openAtLogin: true, path: ex, args: [ - '--process-start-args', '"--hidden"' + '--hideWindow', '"true"' ] }) } diff --git a/packages/gui/vue.config.js b/packages/gui/vue.config.js index f2cb7c8..ce8ad01 100644 --- a/packages/gui/vue.config.js +++ b/packages/gui/vue.config.js @@ -67,8 +67,8 @@ module.exports = { ] }, win: { - icon: 'build/icons/', - requestedExecutionLevel: 'requireAdministrator' + icon: 'build/icons/' + // requestedExecutionLevel: 'highestAvailable' // 加了这个无法开机自启 }, linux: { icon: 'build/mac/',