gaoshuaixing 4 yıl önce
ebeveyn
işleme
312fcaa31f

BIN
build/extraResources/powershelld.exe


+ 1 - 0
build/extraResources/read.txt

@@ -0,0 +1 @@
+建议第三方软件放置在此目录中,打包时会将资源加入安装包内。

+ 1 - 4
electron/apis/example.js

@@ -87,14 +87,11 @@ exports.openSoftware = function (softName = '') {
   let softwarePath = '';
   if (app.isPackaged) {
     // 打包后
-    softwarePath = path.join(app.getAppPath(), "extraResources", softName);
+    softwarePath = path.join(app.getAppPath(), "..", "extraResources", softName);
   } else {
     // 打包前
     softwarePath = path.join(app.getAppPath(), "build", "extraResources", softName);
   }
-  console.log(softwarePath);
-  eLogger.info('[example] [openSoftware] softwarePath:', softwarePath);
-
   // 检查程序是否存在
   if (!fs.existsSync(softwarePath)) {
     return false;

+ 4 - 1
main.js

@@ -5,6 +5,7 @@ const setup = require('./electron/setup')
 const electronConfig = require('./electron/config')
 const storage = require('./electron/lib/storage')
 const preferences = require('./electron/preferences')
+const pkg = require('./package.json');
 
 // main window
 global.MAIN_WINDOW = null
@@ -28,7 +29,9 @@ eggConfig.env = ENV
 // eLogger
 const eLogger = require('./electron/lib/eLogger').get();
 
-if (process.mas) app.setName('electron-egg')
+if (process.mas) {
+  app.setName(pkg.softName)
+}
 
 async function initialize () {
   app.whenReady().then(() => {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "electron-egg",
-  "version": "1.11.0",
+  "version": "1.12.0",
   "description": "A fast, desktop software development framework",
   "main": "main.js",
   "softName": "electron-egg",