 path = require 'path'
 yargs = require 'yargs'
 url = require 'url'
-nslog = require 'nslog'
-
-console.log = nslog
-
-process.on 'uncaughtException', (error={}) ->
-  nslog(error.message) if error.message?
-  nslog(error.stack) if error.stack?
+console.log = require 'nslog'
 
 start = ->
+  setupUncaughtExceptionHandler()
   setupAtomHome()
   setupCompileCache()
-
-  if process.platform is 'win32'
-    SquirrelUpdate = require './squirrel-update'
-    squirrelCommand = process.argv[1]
-    return if SquirrelUpdate.handleStartupEvent(app, squirrelCommand)
+  return if handleStartupEventWithSquirrel()
 
   args = parseCommandLine()
 

  process.env.ATOM_DEV_RESOURCE_PATH ? path.join(app.getHomeDir(), 'github', 'atom')
)

setupCrashReporter = ->
  crashReporter.start(productName: 'Atom', companyName: 'GitHub')

setupAtomHome = ->
  return if process.env.ATOM_HOME

  atomHome = path.join(app.getHomeDir(), '.atom')
  try
    atomHome = fs.realpathSync(atomHome)

        path.resolve(pathToOpen)

    AtomApplication = require path.join(args.resourcePath, 'src', 'browser', 'atom-application')
    AtomApplication.open(args)

    console.log("App load time: #{Date.now() - global.shellStartTime}ms") unless args.test

normalizeDriveLetterName = (filePath) ->
