2016-12-01 18:19:57 -08:00
|
|
|
const os = require('os')
|
|
|
|
const path = require('path')
|
2016-12-30 20:55:42 -08:00
|
|
|
const {spawn} = require('child_process')
|
2016-12-01 18:19:57 -08:00
|
|
|
|
2016-12-30 20:55:42 -08:00
|
|
|
let submitURL = 'http://localhost:1127/post'
|
2016-12-12 21:32:58 -08:00
|
|
|
let productName = 'Child Product'
|
|
|
|
let companyName = 'Child Company'
|
|
|
|
let tmpPath = path.join(os.tmpdir(), productName + ' Crashes')
|
2016-12-01 18:19:57 -08:00
|
|
|
|
2016-12-30 20:55:42 -08:00
|
|
|
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
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2016-12-12 14:35:59 -08:00
|
|
|
process.crashReporter.start({
|
|
|
|
productName: productName,
|
|
|
|
companyName: companyName,
|
2016-12-30 20:55:42 -08:00
|
|
|
submitURL: submitURL,
|
2016-12-12 14:35:59 -08:00
|
|
|
crashesDirectory: tmpPath,
|
|
|
|
extra: {
|
2016-12-01 18:19:57 -08:00
|
|
|
randomData1: 'The Holidays are here!',
|
|
|
|
randomData2: 'Happy New Year!'
|
2016-12-12 14:35:59 -08:00
|
|
|
}
|
2016-12-12 21:32:58 -08:00
|
|
|
})
|
|
|
|
process.crash()
|