title: Auto update electron The remote server returned an error: (404) Not Found
body: <p>I've copied both js files from electron auto-updater into my app</p>
  
  <p>auto-updater-win.js</p>
  
  <pre><code>'use strict'
  
  const {app} = require('electron')
  const {EventEmitter} = require('events')
  const squirrelUpdate = require('./squirrel-update-win')
  
  class AutoUpdater extends EventEmitter {
    quitAndInstall () {
      if (!this.updateAvailable) {
        return this.emitError('No update available, can\'t quit and install')
      }
      squirrelUpdate.processStart()
      app.quit()
    }
  
    getFeedURL () {
      return this.updateURL
    }
  
    setFeedURL (updateURL, headers) {
      this.updateURL = updateURL
    }
  
    checkForUpdates () {
  
      console.log("checkForUpdates/zzzzz");
      if (!this.updateURL) {
        return this.emitError('Update URL is not set')
      }
      if (!squirrelUpdate.supported()) {
        return this.emitError('Can not find Squirrel')
      }
      this.emit('checking-for-update')
      squirrelUpdate.download(this.updateURL, (error, update) =&gt; {
          console.log("squirrelUpdate.download");
  
        if (error != null) {
          return this.emitError(error)
        }
        if (update == null) {
          return this.emit('update-not-available')
        }
        this.updateAvailable = true
        this.emit('update-available')
        squirrelUpdate.update(this.updateURL, (error) =&gt; {
          if (error != null) {
            return this.emitError(error)
          }
          const {releaseNotes, version} = update
          // Date is not available on Windows, so fake it.
          const date = new Date()
          this.emit('update-downloaded', {}, releaseNotes, version, date, this.updateURL, () =&gt; {
            this.quitAndInstall()
          })
        })
      })
    }
  
    // Private: Emit both error object and message, this is to keep compatibility
    // with Old APIs.
    emitError (message) {
      this.emit('error', new Error(message), message)
    }
  }
  
  module.exports = new AutoUpdater()
  </code></pre>
  
  <p>and squirrel-update-win.js</p>
  
  <p>In renderer.js I have set up the auto-updater to use the local files not those from electron</p>
  
  <p>const autoUpdater = require('./auto-updater-win');</p>
  
  <p>checkForUpdates gets fired,</p>
  
  <p>the url looks like <a href="http://test.com:3000/updates/latest?v=1.0.4" rel="nofollow">http://test.com:3000/updates/latest?v=1.0.4</a></p>
  
  <p>it can be accesed from the browser and returns the url to the zip file of the new version in json</p>
  
  <pre><code> this.emit('checking-for-update')
   squirrelUpdate.download(this.updateURL, (error, update) =&gt; {
   console.log("squirrelUpdate.download");
  </code></pre>
  
  <p>...
  also gets called from auto-updater-win.js</p>
  
  <p>then from squirrel-update-win.js
  when </p>
  
  <p>// Download the releases specified by the URL and write new results to stdout.</p>
  
  <pre><code>exports.download = function (updateURL, callback) {
    console.log(updateURL);
    return spawnUpdate(['--download', updateURL], false, function (error, stdout) {...}
  </code></pre>
  
  <p>is hit
  it gives me this error</p>
  
  <p>System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
     at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)</p>
  
  <p>Any Ideea how to solve it? Please I need some help :)</p>
  
  <p>Many thanks.</p>