mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 19:52:10 +08:00
优化软件调用
This commit is contained in:
@@ -38,8 +38,8 @@ class ExampleController extends Controller {
|
||||
async test () {
|
||||
const result = await this.service.example.test('electron');
|
||||
|
||||
// let tmpDir = Utils.getLogDir();
|
||||
// console.log('tmpDir:', tmpDir);
|
||||
let tmpDir = Utils.getLogDir();
|
||||
console.log('tmpDir:', tmpDir);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -421,11 +421,12 @@ class ExampleController extends Controller {
|
||||
let softwarePath = '';
|
||||
if (electronApp.isPackaged) {
|
||||
// 打包后
|
||||
softwarePath = path.join(electronApp.getAppPath(), "..", "extraResources", softName);
|
||||
softwarePath = path.join(this.app.config.execDir, "resources", "extraResources", softName);
|
||||
} else {
|
||||
// 打包前
|
||||
softwarePath = path.join(electronApp.getAppPath(), "build", "extraResources", softName);
|
||||
softwarePath = path.join(this.app.config.execDir, "build", "extraResources", softName);
|
||||
}
|
||||
|
||||
// 检查程序是否存在
|
||||
if (!fs.existsSync(softwarePath)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user