2017-08-16 18 views
0

私は電子を初めて使い、メインウィンドウ内で非電子実行可能ファイルを実行したいと思います。それは可能ですか?非電子実行可能な電子ウィンドウ内で実行する

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); 
}); 

ありがとう:

は、ここに私のコードです。

答えて

0

私はあなたがする必要がある以外、あなたは正しい軌道に乗っていると思う:

const { execFile } = require('child_process').execFile; 

の代わりに:

const { execFile } = require('child_process'); 

execFile docs here.

関連する問題