Error during update download
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.
Can you show me what's on line 130 of your main.js file?
updater.enabled = true
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 } }) })
@yap241986 I don't know what updater is in your code. It's not part of this example application though.
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)
@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.
For instance, if you remove updater.enabled = true I think you wouldn't get an error anymore.
thank you I only remove the custom messages.
how can I set a custom html progress bar for update progress/download?
@yap241986 Take a look at the download-progress event: https://www.electron.build/auto-update#event-download-progress
@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