File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ app.setPath('userData', userDataPath);
3535// Set temp directory based on crash-reporter-directory CLI argument
3636// The crash reporter will store crashes in temp folder so we need
3737// to change that location accordingly.
38+
39+ // If a crash-reporter-directory is specified we setup the crash reporter
40+ // right from the beginning as early as possible to monitor all processes.
3841let crashReporterDirectory = args [ 'crash-reporter-directory' ] ;
3942if ( crashReporterDirectory ) {
4043 crashReporterDirectory = path . normalize ( crashReporterDirectory ) ;
@@ -47,8 +50,20 @@ if (crashReporterDirectory) {
4750 app . exit ( 1 ) ;
4851 }
4952 }
53+
54+ // Crashes are stored in the temp directory by default, so we
55+ // need to change that directory to the provided one
5056 console . log ( `Found --crash-reporter-directory argument. Setting temp directory to be '${ crashReporterDirectory } '` ) ;
5157 app . setPath ( 'temp' , crashReporterDirectory ) ;
58+
59+ // Start crash reporter
60+ const { crashReporter } = require ( 'electron' ) ;
61+ crashReporter . start ( {
62+ companyName : 'Microsoft' ,
63+ productName : product . nameShort ,
64+ submitURL : '' ,
65+ uploadToServer : false
66+ } ) ;
5267}
5368
5469// Set logs path before app 'ready' event if running portable
You can’t perform that action at this time.
0 commit comments