Skip to content

Commit 3b109f7

Browse files
committed
Include current version in update check explicitly
Hopefully fix element-hq#2847
1 parent 205676a commit 3b109f7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎electron/src/electron-main.js‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,15 @@ function startAutoUpdate(update_base_url) {
112112
// 204 No Content. On windows it takes a base path and looks for
113113
// files under that path.
114114
if (process.platform == 'darwin') {
115-
electron.autoUpdater.setFeedURL(update_base_url + 'macos/');
115+
// include the current version in the URL we hit. Electron doesn't add
116+
// it anywhere (apart from the User-Agent) so it's up to us. We could
117+
// (and previously did) just use the User-Agent, but this doesn't
118+
// rely on NSURLConnection setting the User-Agent to what we expect,
119+
// and also acts as a convenient cache-buster between versions.
120+
electron.autoUpdater.setFeedURL(
121+
update_base_url +
122+
'macos/?localVersion=' + encodeURIComponent(electron.app.getVersion())
123+
);
116124
} else if (process.platform == 'win32') {
117125
electron.autoUpdater.setFeedURL(update_base_url + 'win32/' + process.arch + '/');
118126
} else {

0 commit comments

Comments
 (0)