electron-updater-example icon indicating copy to clipboard operation
electron-updater-example copied to clipboard

Error during update download

Open ilgrandeanonimo opened this issue 4 years ago • 12 comments

Found version 2.0.0 (url: myapp-2.0.0-arm64-mac.zip, myapp-2.0.0-arm64.dmg) (node:8559) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'enabled' of undefined at /Users/gattino09/Dev/NodeJS/Electron/myapp/dist/mac-arm64/myapp.app/Contents/Resources/app.asar/main.js:130:23 at processTicksAndRejections (internal/process/task_queues.js:93:5) (Use myapp --trace-warnings ... to show where the warning was created) (node:8559) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:8559) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

ilgrandeanonimo avatar Oct 19 '21 09:10 ilgrandeanonimo

Can you show me what's on line 130 of your main.js file?

iffy avatar Oct 19 '21 12:10 iffy

  updater.enabled = true

ilgrandeanonimo avatar Oct 19 '21 15:10 ilgrandeanonimo

the complete function: !! the title, the message and the buttons are in Italian.

autoUpdater.on('update-available', () => { dialog.showMessageBox({ type: 'info', title: 'Aggiornamento Disponibile', message: 'è disponibile un aggiornamento installarlo?', buttons: ['Si', 'No'] }).then((buttonIndex) => { if (buttonIndex === 0) { autoUpdater.downloadUpdate() } else { updater.enabled = true updater = null } }) })

ilgrandeanonimo avatar Oct 19 '21 15:10 ilgrandeanonimo

@yap241986 I don't know what updater is in your code. It's not part of this example application though.

iffy avatar Oct 19 '21 16:10 iffy

if I sent to you all my code you can try to fix that problem? (if you see grammatical error the reason is that I'm Italian)

ilgrandeanonimo avatar Oct 19 '21 17:10 ilgrandeanonimo

@yap241986 That's not really the purpose of this repo. I suggest you start from this template and slowly add your own parts one at a time. Or work in reverse. Remove lines of your code until you don't get an error any more.

iffy avatar Oct 19 '21 17:10 iffy

For instance, if you remove updater.enabled = true I think you wouldn't get an error anymore.

iffy avatar Oct 19 '21 17:10 iffy

thank you I only remove the custom messages.

ilgrandeanonimo avatar Oct 19 '21 17:10 ilgrandeanonimo

how can I set a custom html progress bar for update progress/download?

ilgrandeanonimo avatar Oct 20 '21 11:10 ilgrandeanonimo

@yap241986 Take a look at the download-progress event: https://www.electron.build/auto-update#event-download-progress

iffy avatar Oct 20 '21 12:10 iffy

Update Downloading...

ilgrandeanonimo avatar Oct 20 '21 19:10 ilgrandeanonimo

@yap241986 I don't know. There are many ways you could do it. Here's what I found searching "electron-updater progress bar": https://stackoverflow.com/a/54533407/1379037

iffy avatar Oct 21 '21 11:10 iffy