         pythonLocation(callback, locations)
     )
 
-installPython = () ->
-  if os.type() is 'Windows_NT'
-    pyVer = '3.5.1'
-    arch = 'win32'
-    if os.arch().indexOf('x64') > -1
-      arch = 'amd64'
-    url = 'https://www.python.org/ftp/python/' + pyVer + '/python-' + pyVer + '-embed-' + arch + '.zip'
-
-    console.log 'Downloading python...'
-    zipFile = __dirname + path.sep + 'python.zip'
-    downloadFile(url, zipFile, ->
-
-      console.log 'Extracting python...'
-      unzip(zipFile, __dirname + path.sep + 'python', ->
-          fs.unlink(zipFile)
-          console.log 'Finished installing python.'
-      )
+installPython = (callback) ->
+  pyVer = '3.5.1'
+  arch = 'win32'
+  if os.arch().indexOf('x64') > -1
+    arch = 'amd64'
+  url = 'https://www.python.org/ftp/python/' + pyVer + '/python-' + pyVer + '-embed-' + arch + '.zip'
+
+  console.log 'downloading python...'
+  statusBarTileView?.setStatus('downloading python...')
+
+  zipFile = __dirname + path.sep + 'python.zip'
+  downloadFile(url, zipFile, ->
+
+    console.log 'extracting python...'
+    statusBarTileView?.setStatus('extracting python...')
+
+    unzip(zipFile, __dirname + path.sep + 'python', ->
+        fs.unlink(zipFile)
+        console.log 'Finished installing python.'
+        if callback?
+          callback()
     )
-  else
-    window.alert('WakaTime depends on Python. Install it from https://python.org/downloads then restart Atom.')
+  )
 
 isCLIInstalled = () ->
   return fs.existsSync(cliLocation())


  activate: (state) ->
    packageVersion = atom.packages.getLoadedPackage('wakatime').metadata.version

    if not isCLIInstalled()
      installCLI(->
        console.log 'Finished installing wakatime cli.'
      )
    else
      isCLILatest((latest) ->
        if not latest
          installCLI(->
            console.log 'Finished installing wakatime cli.'
          )
      )
    isPythonInstalled((installed) ->
      if not installed
        atom.confirm
          message: 'WakaTime requires Python'
          detailedMessage: 'Let\'s download and install Python now?'
          buttons:
            OK: -> installPython()
            Cancel: -> window.alert('Please install Python (https://www.python.org/downloads/) and restart Atom to enable the WakaTime plugin.')
    )
    cleanupOnUninstall()
    setupEventHandlers()
    setupConfigs()
    statusBarTileView?.setTitle('WakaTime initialized')
    statusBarTileView?.setStatus()
    @settingChangedObserver = atom.config.observe 'wakatime', settingChangedHandler

  consumeStatusBar: (statusBar) ->
    statusBarTileView = new StatusBarTileView()
    statusBarTileView.init()
    @statusBarTile = statusBar?.addRightTile(item: statusBarTileView, priority: 300)
    if pluginReady
      statusBarTileView.setTitle('WakaTime initialized')
      statusBarTileView.setStatus()
      if not atom.config.get 'wakatime.showStatusBarIcon'
        statusBarTileView?.hide()

            status = 'Error'
            title = 'Unknown Error (' + proc.exitCode + '); Check your Dev Console and ~/.wakatime.log for more info.'

          if msg?
            console.warn msg
          statusBarTileView?.setStatus(status)
          statusBarTileView?.setTitle(title)

