mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 11:52:07 +08:00
优化资源路径
This commit is contained in:
@@ -418,14 +418,16 @@ class ExampleController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 资源路径不同
|
// 资源路径不同
|
||||||
let softwarePath = '';
|
// let softwarePath = '';
|
||||||
if (electronApp.isPackaged) {
|
// if (electronApp.isPackaged) {
|
||||||
// 打包后 execDir为 应用程序 exe\dmg\dep软件所在目录;打包前该值是项目根目录
|
// // 打包后 execDir为 应用程序 exe\dmg\dep软件所在目录;打包前该值是项目根目录
|
||||||
softwarePath = path.join(this.app.config.execDir, "resources", "extraResources", softName);
|
// softwarePath = path.join(this.app.config.execDir, "resources", "extraResources", softName);
|
||||||
} else {
|
// } else {
|
||||||
// 打包前
|
// // 打包前
|
||||||
softwarePath = path.join(this.app.config.execDir, "build", "extraResources", softName);
|
// softwarePath = path.join(this.app.config.execDir, "build", "extraResources", softName);
|
||||||
}
|
// }
|
||||||
|
let softwarePath = path.join(Utils.getExtraResourcesDir(), softName);
|
||||||
|
this.app.logger.info('[openSoftware] softwarePath:', softwarePath);
|
||||||
|
|
||||||
// 检查程序是否存在
|
// 检查程序是否存在
|
||||||
if (!fs.existsSync(softwarePath)) {
|
if (!fs.existsSync(softwarePath)) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const awaken = require('../library/awaken');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 预加载模块入口
|
* 预加载模块入口
|
||||||
|
* @param {Object} app - 全局app对象
|
||||||
*/
|
*/
|
||||||
module.exports = async (app) => {
|
module.exports = async (app) => {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user