Auto-update not working on WIN10
See original GitHub issueHere what I’m experiencing:
- I have both releases 0.1.31 and 0.1.32 on the repo GitHub
- I install 0.1.31
- I start 0.1.31
- nothing is prompt (should checkForUpdateAndNotify() notify user about the new update?)
- app closes
Code:
app.on('ready', async () => {
//try to update!
try {
const info = await autoUpdater.checkForUpdatesAndNotify();
logger.info('checkForUpdatesAndNotify');
logger.info(JSON.stringify(info));
autoUpdater.on('update-downloaded', info => {
const quitAndInstalled = autoUpdater.quitAndInstall();
logger.info('quitAndInstalled');
logger.info(quitAndInstalled);
});
autoUpdater.on('update-available', arg => {
logger.info('update-available');
logger.info(arg);
});
autoUpdater.on('update-not-available', arg => {
logger.info('update-not-available');
logger.info(arg);
});
autoUpdater.on('download-progress', arg => {
logger.info('download-progress');
logger.info(arg);
});
autoUpdater.on('error', error => {
logger.info('error');
logger.info(error.message);
logger.info(error.stack);
});
}
catch (error) {
logger.info('autoupdate failed');
}
createWindow();
createOrSyncTrayAndMenu();
});
Here what log.log
in %appdata%
says:
C:\Users\damiano\AppData\Roaming\TAV>type log.log
[2018-06-04 15:58:22.514] [info] ["C:\\Users\\damiano\\AppData\\Local\\Programs\\TAV\\TAV.exe"]
[2018-06-04 15:58:22.579] [info] { defaultProtocolClientSet: true }
[2018-06-04 15:58:23.119] [info] Checking for update
[2018-06-04 15:58:23.365] [info] Generated new staging user ID: d3158bfd-196b-5f31-86ff-5d8941285791
[2018-06-04 15:58:26.478] [info] Found version 0.1.33 (url: TAV.exe)
[2018-06-04 15:58:26.478] [info] Downloading update from TAV.exe
[2018-06-04 15:58:26.478] [info] checkForUpdatesAndNotify
[2018-06-04 15:58:26.478] [info] {"versionInfo":{"version":"0.1.33","files":[{"url":"TAV.exe","sha512":"WdNsGytxp51XzHTEwUijfcG7H1fTt9jcWeQZb+0ukDUpj+i1btPqvVO6sysjwq03QZQP9/2F9mMbcm5+99rfAg==","size":46203281}],"path":"TAV.exe","sha512":"WdNsGytxp51XzHTEwUijfcG7H1fTt9jcWeQZb+0ukDUpj+i1btPqvVO6sysjwq03QZQP9/2F9mMbcm5+99rfAg==","sha2":"8a0c29d271deae77b0d4799c6678fd3a3cf743df03aa9a0703dadfe7d378b4fb","releaseDate":"2018-06-04T10:12:02.502Z","releaseName":"0.1.33","releaseNotes":""},"updateInfo":{"version":"0.1.33","files":[{"url":"TAV.exe","sha512":"WdNsGytxp51XzHTEwUijfcG7H1fTt9jcWeQZb+0ukDUpj+i1btPqvVO6sysjwq03QZQP9/2F9mMbcm5+99rfAg==","size":46203281}],"path":"TAV.exe","sha512":"WdNsGytxp51XzHTEwUijfcG7H1fTt9jcWeQZb+0ukDUpj+i1btPqvVO6sysjwq03QZQP9/2F9mMbcm5+99rfAg==","sha2":"8a0c29d271deae77b0d4799c6678fd3a3cf743df03aa9a0703dadfe7d378b4fb","releaseDate":"2018-06-04T10:12:02.502Z","releaseName":"0.1.33","releaseNotes":""},"cancellationToken":{"domain":null,"_events":{},"_eventsCount":0,"parentCancelHandler":null,"_parent":null,"_cancelled":false},"downloadPromise":{"isFulfilled":false,"isRejected":false}}
[2018-06-04 15:58:26.633] [info] No cached update available
I can see a temp.exe file in the app data folder:
C:\Users\damiano\AppData\Roaming\TAV>dir
Il volume nell'unità C non ha etichetta.
Numero di serie del volume: 12F5-187B
Directory di C:\Users\damiano\AppData\Roaming\TAV
04/06/2018 15:58 <DIR> .
04/06/2018 15:58 <DIR> ..
04/06/2018 15:58 36 .updaterId
04/06/2018 15:58 <DIR> Cache
04/06/2018 15:58 28.672 Cookies
04/06/2018 15:58 0 Cookies-journal
04/06/2018 15:58 <DIR> GPUCache
04/06/2018 15:57 46.203.376 installer.exe
04/06/2018 15:58 1.703 log.log
04/06/2018 15:58 <DIR> logs
04/06/2018 15:58 5.377.381 temp-installer-0.1.33.exe <== here!
But If I try to open it manually I get the following:
I see the temp-installer.exe is just 5MB while the .exe in the release on GitHub is 44MB.
I’m not sure whether a differential download is made (is this possible?) but I think the file download failed without firing the ‘error’ event (resulting a corrupted .exe file).
Furthermore update-downloaded
event is not logged, so probably the app is not closed by the autoUpdater.quitAndInstall()
call?
What do you think? Is this a bug?
Versions and nsis config:
{
"build": {
...
"asar": true,
"win": {
"target": "nsis",
"icon": "./icons/logo.ico",
"publisherName": "Translated SRL"
},
"nsis": {
"oneClick": false,
"perMachine": true,
"allowElevation": true,
"deleteAppDataOnUninstall": true,
"createDesktopShortcut": "always",
"menuCategory": "Translated - TAV",
"installerHeaderIcon": "./icons/logo.ico",
"installerIcon": "./icons/logo.ico",
"uninstallerIcon": "./icons/logo.ico",
"installerSidebar": "./icons/win-installer-sidebar.bmp",
"installerHeader": "./icons/win-installer-header.bmp",
"uninstallerSidebar": "./icons/win-uninstaller-sidebar.bmp",
"license": "./assets/license.txt"
},
...
},
"dependencies": {
"auto-launch": "^5.0.5",
"better-console": "^1.0.1",
"electron-log": "^2.2.14",
"electron-updater": "^2.21.10",
"lodash": "^4.17.10",
"luxon": "^1.2.1",
"mz": "^2.7.0",
"sleep-promise": "^6.0.0",
"typeface-montserrat": "^0.0.54",
"ws": "^5.1.1"
},
"devDependencies": {
"babel-eslint": "^8.2.3",
"electron": "^2.0.1",
"electron-builder": "^20.13.4",
"electron-debug": "^1.5.0",
"electron-reload": "^1.2.2",
"eslint": "^4.19.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-jest": "^21.15.0",
"eslint-plugin-react": "^7.7.0",
"png2icns": "^0.0.1"
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Windows Automatic updates not working - Microsoft Community
1- Stop the update service. Run these commands in command prompt (Admin):. net stop bits · 2- Clear the windows update cache. Delete...
Read more >Full Fix: Windows 10/11 automatic update problems
Automatic update problems on Windows 10, how to fix them? · 1. Change Windows Update settings · 2. Check your antivirus · 3....
Read more >7 Solutions to Fix Windows 10 Won't Update. #6 Is Fantastic
Why Windows 10 Won't Update; Remove Third-party Security Software; Check Windows Update Utility Manually; Keep All Services about Windows Update ...
Read more >How to Enable Auto-Updates in Windows 10 | The InfoSec Blog
From Settings, tap or click on Update & security. Choose Windows Update from the menu on the left, assuming it's not already selected....
Read more >Windows Update Not Working for Your Latest Upgrade ...
Windows Update not working for your latest upgrade? Here's how to fix it · Manage automatic updates · Windows 10 Update Change Active...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Smart move, thanks @peterdanis! I’m packing locally triggering the update without pushing to GitHub.
However the app just dies in the middle of downloading update with no error. I tried removing the
makeSingleInstance
logic but it doesn’t matter. Notification withcheckForUpdatesAndNotify
never worked.Any idea? I’ve run out of ideas 😔
Do you want some help, for example: I have an application that can update what this server does not, but it downloads that update but does not update, something that is missing? follow my .json and main.js
The .logs file looks like this …,