question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App will not automatically update, errors out.

See original GitHub issue
  • Version 22.10.5:
  • Electron Version 12.0.5:
  • Electron Type (current):
  • Electron builder 4.3.8
  • Target windows:

So, the app starts the update, but it never reaches the event “update-downloaded”, it never gets there. I am not sure why, but, i am able to view the download progress, it finishes, but never emits the event, or actually downloads the update.

Here is my code for my main process

const { app, BrowserWindow, ipcMain, Notification } = require("electron")
const { autoUpdater } = require('electron-updater')

const windows = {}

app.on("ready", () => {

    windows.updater = new BrowserWindow({
        width: 310,
        height: 390,
        fullscreenable: false,
        frame: false,
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false,
        }
    })

    windows.updater.loadFile("./src/screens/updater/index.html")

    autoUpdater.checkForUpdatesAndNotify()

    new Notification({
        body: "Test notification"
    }).show()
})

app.on("window-all-closed", () => {
    if (process.platform !== "darwin") {
        app.quit()
    }
})

ipcMain.on("get-app-version", event => {
    event.sender.send("app-version", { version: app.getVersion() })
})

autoUpdater.on("update-available", () => {
    new Notification({
        body: "an update is available to your app, it will start downloading"
    }).show()
})



autoUpdater.on("update-downloaded", () => {
    new Notification({
        body: "an update has been downloaded to your app, it will now close and install."
    }).show()

    autoUpdater.quitAndInstall()
})

autoUpdater.on("update-not-available", () => {
    new Notification({
        body: "App is up to date!!"
    }).show()
})

autoUpdater.on("error", err => {
    new Notification({
        body: err.message
    }).show()
})

autoUpdater.on('download-progress', (progressObj) => {
    let log_message = "Download speed: " + progressObj.bytesPerSecond;
    log_message = log_message + ' - Downloaded ' + progressObj.percent + '%';
    log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')';
    new Notification({
        body: log_message
    }).show()
})

Any help is appreciated, i have been raging for the last four hours because for every fix i test on my own, it requires me to publish the fix, then publish the same fix but with a new version number, and then open the fix file, and it has become very tedious and irritating and i need some fresh sets of eyes to check it out. I can link to the source codes repo if anyone needs.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
ghostcommented, Apr 25, 2021

Update: after ten minutes, it said net::ERR_CONNECTION_CLOSED so it never even makes it past the download request to github

0reactions
mmaiettacommented, May 9, 2021

We couldn’t determine the origin for the 50mb limit. So we increased it arbitrarily to 500mb in v22.11.1 via #5843

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic App Updates Not Working, Fix - macReports
This article explains how you can troubleshoot if automatic app updates are not working properly on your iPhone or iPad.
Read more >
Automatic software or app updates not working on your ...
Here are all the steps you need to take if automatic software or app updates are not working on your iPhone. We'll get...
Read more >
Top 10 Ways to Fix Apps Not Updating on Android
Top 10 Ways to Fix Apps Not Updating on Android · 1. Check Internet Connection · 2. Check Device Storage · 3. Auto-Update...
Read more >
If your iPhone or iPad won't update - Apple Support
If there isn't enough space to download and install an update, the software on your device will try to make space. It will...
Read more >
My iPhone Apps Won't Update! Here's The Fix.
Apps Not Updating On Cellular Automatically? ... Open Settings and tap App Store. Make sure the switch next to App Updates is turned...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found