Autoupdater problem on mac if space in the name
See original GitHub issue- Version: 12.0.3
- Target: Mac
I have my app packaged correctly and uploaded to an S3 bucket (something which I previously did with the Windows version), but the autoupdater doesn’t work on mac (it works fine on Windows though).
When running my app from the terminal so I can see the logging I see this:
App is ready
Checking for update
Found version 1.0.91 (url: https://s3-eu-west-1.amazonaws.com/*****/releases/MyApp-1.0.91-mac.zip)
Downloading update from https://s3-eu-west-1.amazonaws.com/*****/releases/MyApp-1.0.91-mac.zip
{ Error: Update check failed. The server sent an invalid JSON response. Try again later.
preventDefault: [Function: preventDefault],
sender:
AutoUpdater {
_events: { error: [Function], 'update-downloaded': [Function] },
_eventsCount: 2 } }
Error: Error: Update check failed. The server sent an invalid JSON response. Try again later.
latest-mac.json
contains
{
"version": "1.0.91",
"url": "https://s3-eu-west-1.amazonaws.com/*****/releases/MyApp-1.0.91-mac.zip"
}
What could be the problem?
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (7 by maintainers)
Top Results From Across the Web
Auto Update - electron-builder
Simplified auto-update is supported on Windows if you use the default ... Mac, otherwise latest-mac.yml cannot be created, which causes autoUpdater error.
Read more >Update macOS on Mac - Apple Support
Use Software Update to install updates and upgrades for macOS and its built-in apps, ... If you don't have enough storage space to...
Read more >What Is Microsoft AutoUpdate on Mac and How to Delete It
The Microsoft AutoUpdate program stays operational even if you no longer have any Microsoft app installed on your Mac. That's a bit silly,...
Read more >My Mac suddenly ran out of space - Ask Different
First of all, try disabling Time Machine, and erasing snapshots from your system. Open the terminal, and type the following:
Read more >Troubleshoot Microsoft AutoUpdate in Microsoft 365 and ...
Help if you get an error using Microsoft AutoUpdate for Microsoft 365 or Office for Mac.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
Bingo!
Sometimes it helps to walk away from the computer in order to find it. My Product Name has spaces in it, therefore the generated JSON file also has spaces in the URL. I manually edited the JSON file on S3 and replaced the spaces with %20 and it works!
The
yml
file for my windows updates also contains the spaces in the file name, but it seems that isn’t a problem as I guess you build the URL yourself from the filename.So I guess it would be a good idea to URLEncode the filename that is put in
latest-mac.json
before upload.That was a productive day …
Looks like it should be
const {autoUpdater} = require('electron-updater')
orconst autoUpdater = require('electron-updater').autoUpdater
based on the wiki.