     execPath = "." #process.execPath
     filePath = execPath.substr(0, execPath.lastIndexOf("\\"))
     appPath = path.normalize(execPath ) #+ "/../../../../../../..")
-
+    downloadTarget = os.tmpdir() + "/" + ".update.zip"
     self = this
 
     console.log "Requesting updates"

request = require 'request'
progress = require 'request-progress'
path = require 'path'
fs = require 'fs'

packageFile = require './package.json'

      console.log "Remote Version: #{remoteVersion}"
      if semver.lt(localVersion, remoteVersion)
        console.log "Remote is newer!"
        self._download_update(downloadTarget,
         "#{updateServer}/#{packageFile.name}-osx-ia32.zip",
         (state) ->
           console.log state
        , cb)
      else
        console.log "No updates."

  _download_update: (targetPath, remoteUrl, progressCb, doneCb) ->
    progress(request(remoteUrl))
      .on('progress', progressCb)
      .on('error', doneCb)
      .pipe(fs.createWriteStream(targetPath))
      .on('close', doneCb)


