Support crash reporting from child process in Windows

This commit is contained in:
Ramya Achutha Rao 2016-12-30 20:55:42 -08:00 committed by Kevin Sawicki
parent 2814e04e7d
commit d453dbdb40

View file

@ -1,14 +1,31 @@
const os = require('os')
const path = require('path')
const {spawn} = require('child_process')
let submitURL = 'http://localhost:1127/post'
let productName = 'Child Product'
let companyName = 'Child Company'
let tmpPath = path.join(os.tmpdir(), productName + ' Crashes')
if (process.platform === 'win32') {
const args = [
'--reporter-url=' + submitURL,
'--application-name=' + productName,
'--crashes-directory=' + tmpPath
]
const env = {
ELECTRON_INTERNAL_CRASH_SERVICE: 1
}
spawn(process.execPath, args, {
env: env,
detached: true
})
}
process.crashReporter.start({
productName: productName,
companyName: companyName,
submitURL: 'http://localhost:1127/post',
submitURL: submitURL,
crashesDirectory: tmpPath,
extra: {
randomData1: 'The Holidays are here!',