This commit is contained in:
fanxb 2024-01-03 22:11:08 +08:00
parent f04d3bf636
commit 8c6416ec87
3 changed files with 9 additions and 7 deletions

View File

@ -2,6 +2,7 @@
// 控制应用生命周期和创建原生浏览器窗口的模组
const {app, BrowserWindow, Menu} = require('electron')
const path = require('path')
const fs = require('fs');
const {spawn} = require('child_process');
const net = require('net');
const log = require('electron-log');
@ -65,7 +66,8 @@ async function startBackend() {
}
let userHome = process.env.HOME || process.env.USERPROFILE;
let dataPath = path.join(userHome, "openRenamer");
const childProcess = spawn('node', ['openRenamerBackend/dist/index.js'], {
let exist = fs.existsSync("./openRenamerBackend");
const childProcess = spawn('node', [exist ? './' : '../' + 'openRenamerBackend/dist/index.js'], {
env: {
"PORT": port,
"DATA_PATH": dataPath

View File

@ -16,7 +16,7 @@
},
"build": {
"productName": "openRenamer",
"appId": "electron.app",
"appId": "openRenamer.app",
"directories": {
"output": "build"
},
@ -35,9 +35,9 @@
"oneClick": false,
"allowElevation": true,
"allowToChangeInstallationDirectory": true,
"installerIcon": "./openRenamerBackend/static/favicon.ico",
"uninstallerIcon": "./openRenamerBackend/static/favicon.ico",
"installerHeaderIcon": "./openRenamerBackend/static/favicon.ico",
"installerIcon": "../openRenamerBackend/static/favicon.ico",
"uninstallerIcon": "../openRenamerBackend/static/favicon.ico",
"installerHeaderIcon": "../openRenamerBackend/static/favicon.ico",
"createDesktopShortcut": true,
"createStartMenuShortcut": true,
"shortcutName": "openRenamer"

View File

@ -9,8 +9,8 @@
},
"dependencies": {
"@element-plus/icons-vue": "2.0.10",
"axios": "0.21.1",
"core-js": "3.6.5",
"axios": "1.6.0",
"core-js": "3.35.0",
"dayjs": "1.10.7",
"element-plus": "2.2.25",
"vue": "3.2.45",