|
|
@ -5,6 +5,7 @@ const store = require('./windows/lib/store'); |
|
|
|
const {create: createMainWindow} = require('./windows/main') |
|
|
|
// const { create: createLoginWindow } = require('./windows/login')
|
|
|
|
// const { create: createAppWindow } = require('./windows/app')
|
|
|
|
const childProcess = require('./child_process') |
|
|
|
|
|
|
|
const {MAIN_WINDOW_FLAG, SUSPENSION_WINDOW_FLAG} = require('./constant'); |
|
|
|
// const installApp = require('./ipc/installApp');
|
|
|
@ -209,4 +210,24 @@ module.exports = () => { |
|
|
|
// ipcMain.handle('getApps', getApps);
|
|
|
|
//
|
|
|
|
// ipcMain.handle('removeApp', removeApp);
|
|
|
|
|
|
|
|
/* 示例 |
|
|
|
ipcRenderer.send('spawn', { |
|
|
|
command: '微信.exe', |
|
|
|
args: null || ['--disable-cache'], |
|
|
|
key: + new Date // 唯一key,用来做关闭识别
|
|
|
|
}) |
|
|
|
*/ |
|
|
|
ipcMain.on('spawn', (event, arg) => { |
|
|
|
const pid = childProcess.start(arg.command, arg.args) |
|
|
|
event.sender.send('spawn-success', { |
|
|
|
key: arg.key, |
|
|
|
pid |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
// ipcRenderer.send('kill-process', [pid])
|
|
|
|
ipcMain.on('kill-process', function (event, arg) { |
|
|
|
childProcess.kill(arg[0]) |
|
|
|
}) |
|
|
|
} |