如何解决Electron无法启动exe?
我的电子应用无法启动我的游戏并重新调整错误代码:3221225781
登录
Error: Command failed: C:\\Users\\thaly\\AppData\\Local\\Programs\\games\\resources\\Main.exe abeta
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
killed: false,code: 3221225781,signal: null,cmd: 'C:\\Users\\thaly\\AppData\\Local\\Programs\\games\\resources\\Main.exe abeta'
}
执行代码:
class ExecFile {
execute(fileName: string,params: string[],path: string) {
console.log(`${path}`)
execFile(`${path}\\${fileName}`,params,{ cwd: path },(error: ExecException | null,stdout: string,stderr: string) => {
console.log(error)
console.log(stdout)
console.log(stderr)
if (error) {
dialog.showMessageBox({ title: 'Launcher Error',type: 'error',message: `${error.code}`,detail: `${stderr}` })
} else {
}
})
return 0
}
}
在background.js中
event.reply('execResult',ExecFile.execute('Main.exe',arg,`${localPath}\\resources`))
我正在使用{ cwd: path }
,但将shell作为true无效
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。