const Factory = require('./factory.js') const { app, BrowserWindow, ipcMain, ipcRenderer } = require('electron') const { tmpdir } = require('node:os') const path = require('node:path') const createWindow = () => { const win = new BrowserWindow({ width: 1400, height: 1200, webPreferences: { preload: path.join(__dirname, 'preload.js') } }) win.loadFile('index.html') } tmp = tmpdir() app.disableHardwareAcceleration() app.whenReady().then(() => { ipcMain.handle('run', (_, param) => { Factory.get(param.workflow) Factory.workflow.run(param.application, param, tmp) }) createWindow() app.on('window-all-closed', () => { app.quit() }) }) app.on('window-all-closed', () => { app.quit() })