I'm new to Electron and I'd like to run a non electron executable inside my main window. Is it possible to do that?
Here is my code:
mainWindow = new BrowserWindow({width: 860, height: 645})
mainWindow.loadURL('https://url.com/')
const { execFile } = require('child_process');
const child = execFile('C:\\test\\content.exe', {cwd: 'C:\\test\\'}, (error, stdout, stderr) => {
if (error) {
throw error;
}
console.log(stdout);
});
Thanks.
I think you're on the right track except you need to do:
const { execFile } = require('child_process').execFile;
Instead of:
const { execFile } = require('child_process');
execFile
docs here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With