       app.quit() if process.platform is 'win32'
 
     app.on 'will-quit', =>
-      fs.unlinkSync socketPath if fs.existsSync(socketPath) # Clean the socket file when quit normally.
+      # Clean the socket file when quit normally.
+      if process.platform isnt 'win32' and fs.existsSync(socketPath)
+        fs.unlinkSync socketPath
 
     app.on 'open-file', (event, pathToOpen) =>
       event.preventDefault()

    # take a few seconds to trigger 'error' event, it could be a bug of node
    # or atom-shell, before it's fixed we check the existence of socketPath to
    # speedup startup.
    if (not fs.existsSync socketPath) or options.test
      createAtomApplication()
      return


{EventEmitter} = require 'events'
_ = require 'underscore-plus'

socketPath =
  if process.platform is 'win32'
    '\\\\.\\pipe\\atom-sock'
  else
    path.join(os.tmpdir(), 'atom.sock')

# Private: The application's singleton class.
#
