Send the current arch when updating

This depends on further builder changes to actually place updates at this new
location for both architectures.
This commit is contained in:
J. Ryan Stinnett 2021-06-23 15:51:14 +01:00
parent c5dd6195f2
commit f63436a2cb

View file

@ -30,14 +30,14 @@ module.exports.start = function startAutoUpdate(updateBaseUrl) {
// hits a URL that either gives it a 200 with some json or
// 204 No Content. On windows it takes a base path and looks for
// files under that path.
if (process.platform === 'darwin' && process.arch === 'x64') {
if (process.platform === 'darwin') {
// include the current version in the URL we hit. Electron doesn't add
// it anywhere (apart from the User-Agent) so it's up to us. We could
// (and previously did) just use the User-Agent, but this doesn't
// rely on NSURLConnection setting the User-Agent to what we expect,
// and also acts as a convenient cache-buster to ensure that when the
// app updates it always gets a fresh value to avoid update-looping.
url = `${updateBaseUrl}macos/?localVersion=${encodeURIComponent(app.getVersion())}`;
url = `${updateBaseUrl}macos/${process.arch}/?localVersion=${encodeURIComponent(app.getVersion())}`;
} else if (process.platform === 'win32') {
url = `${updateBaseUrl}win32/${process.arch}/`;
} else {