Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit f6414bd

Browse files
committed
Fix update progress display
1 parent bf4a3dd commit f6414bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/autoUpdater.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function(inLoading, contents, customWindowEvent){
3434
myEmitter.on('online', () =>{
3535
clearInterval(connexionCheck)
3636
const { autoUpdater } = require("electron-updater")
37-
autoUpdater.checkForUpdatesAndNotify();
37+
autoUpdater.checkForUpdates();
3838

3939
autoUpdater.on('checking-for-update', () => {
4040
log.info('Checking for updates...')
@@ -63,14 +63,14 @@ module.exports = function(inLoading, contents, customWindowEvent){
6363
})
6464
autoUpdater.on('download-progress', (progressObj) => {
6565
log.verbose(progressObj)
66-
contents.executeJavaScript(`document.getElementById('updatetxt').innerText = \`${progressObj.percent}% - ${progressObj.transferred}/${progressObj.total} (${progressObj.bytesPerSecond})\``)
66+
contents.executeJavaScript(`document.getElementById('updatetxt').innerText = \`${progressObj.percent.toFixed(0)}% - ${(progressObj.transferred/1048576).toFixed(2)} MB/${(progressObj.total/1048576).toFixed(2)} MB (${(progressObj.bytesPerSecond/1048576).toFixed(3)} MB/S)\``)
6767
})
6868
autoUpdater.on('update-downloaded', (info) => {
6969
log.info('Update downloaded!')
7070
log.verbose(info)
7171
contents.executeJavaScript("document.getElementById('updatetxt').innerText = 'Update downloaded'")
7272
wait(5000).then(()=>{
73-
autoUpdater.quitAndInstall();
73+
autoUpdater.quitAndInstall(false, true);
7474
})
7575
})
7676
})

0 commit comments

Comments
 (0)