|
|
@@ -37,7 +37,11 @@ class MainSerivce {
|
|
|
alwaysOnTop: true,
|
|
|
transparent: true // 窗口是否支持透明,如果想做高级效果最好为true
|
|
|
})
|
|
|
- this.loadingWin.loadFile('loading.html')
|
|
|
+ if (app.isPackaged) {
|
|
|
+ this.loadingWin.loadFile(join(__dirname, './loading.html'))
|
|
|
+ } else {
|
|
|
+ this.loadingWin.loadFile('loading.html')
|
|
|
+ }
|
|
|
this.loadingWin.on('close', () => {
|
|
|
this.loadingWin = null
|
|
|
})
|
|
|
@@ -64,7 +68,7 @@ class MainSerivce {
|
|
|
|
|
|
// 不同环境加载不同文件
|
|
|
if (app.isPackaged) {
|
|
|
- this.mainWin.loadFile('dist/index.html')
|
|
|
+ this.mainWin.loadFile(join(__dirname, './index.html'))
|
|
|
} else {
|
|
|
this.mainWin.loadURL('http://localhost:6547/')
|
|
|
}
|
|
|
@@ -109,7 +113,7 @@ class MainSerivce {
|
|
|
return true
|
|
|
})
|
|
|
} else if (platform === 'darwin') {
|
|
|
- app.dock.setIcon(join(__dirname, './icon/playGame@2x.png'))
|
|
|
+ app.dock.setIcon(join(__dirname, 'electron/icon/playGame@2x.png'))
|
|
|
}
|
|
|
|
|
|
// 通信
|
|
|
@@ -172,7 +176,7 @@ class MainSerivce {
|
|
|
}
|
|
|
|
|
|
connectLogi() {
|
|
|
- this.contrlEvent = fork(join(__dirname, './logiControl.js'));
|
|
|
+ this.contrlEvent = fork(join(__dirname, 'electron/logiControl.js'));
|
|
|
this.contrlEvent.on('message', msg => {
|
|
|
if (!msg || msg.type === 'err' || !msg.data || !msg.data[44]) {
|
|
|
this.contrlEvent.disconnect()
|