import { app , crashReporter } from 'electron' ; import * as path from 'path' ; import { isDevEnv , isNodeEnv } from '../common/env' ; import { logger } from '../common/logger' ; import { getCommandLineArgs } from '../common/utils' ; import { appStats } from './stats' ; const userDataPathArg = getCommandLineArgs ( process . argv , '--userDataPath=' , false ) ; const userDataPath = userDataPathArg && userDataPathArg . substring ( userDataPathArg . indexOf ( '=' ) + 1 ) ; if ( ! isNodeEnv ) { app . enableSandbox ( ) ; app . setAppUserModelId ( 'symphony_exe' ) ; } app . setAppUserModelId ( 'com.symphony.electron-desktop' ) ; if ( isDevEnv ) { const devDataPath = path . join ( app . getPath ( 'appData' ) , 'Symphony-dev' ) ; logger . info ( `init: Setting user data path to` , devDataPath ) ; app . setPath ( 'userData' , devDataPath ) ; } if ( userDataPath ) { logger . info ( `init: Setting user data path to` , userDataPath ) ; app . setPath ( 'userData' , userDataPath ) ; } logger . info ( `init: Fetch user data path` , app . getPath ( 'userData' ) ) ; logger . info ( `Crashes directory: ${ app . getPath ( 'crashDumps' ) }` ) ; crashReporter . start ( { submitURL : '' , uploadToServer : false , ignoreSystemCrashHandler : false , } ) ; logger . info ( `Crash Reporter started` ) ; appStats . logStats ( ) ; require ( './main' ) ;