electron-builder: macOS auto-update doesn't update and instead relaunches the same version
Hello.
I’ve seen several issues with similar problems here while doing some research on the matter, but I can’t find them anymore, so, sorry if this is a duplicate and you’re already working on it.
Recently we’ve had macOS users reporting they couldn’t update our app. The update detects a new version, downloads it, restarts, but it looks like it’s not installed, and they restart with the same version they had.
During some tests, I found out that running the app from the command-line by opening a terminal and getting into the .app/Contents/MacOS folder to launch the app there… actually works? After the app shutdown, there’s a user password prompt, and then the app restarts as the new version.
Some logs, but unsure if that’ll help since they end at the same place. I cut the app’s specific lines in the logs to keep the Updater ones only
- Not working (launched by double-clicking the app)
{"level":"info","message":"Checking for updates and notify","service":"ElectronUpdater","timestamp":"2025-01-22T09:52:08.875Z"}
{"level":"info","message":"Checking for update","timestamp":"2025-01-22T09:52:08.875Z"}
{"level":"info","message":"Found version 8.0.56 (url: Karaoke Mugen-8.0.56-mac-x64.zip, Karaoke Mugen-8.0.56-mac-arm64.zip, Karaoke Mugen-8.0.56-mac-x64.dmg, Karaoke Mugen-8.0.56-mac-arm64.dmg)","timestamp":"2025-01-22T09:52:09.286Z"}
{"level":"info","message":"Update detected","service":"ElectronUpdater","timestamp":"2025-01-22T09:52:09.286Z"}
{"level":"debug","message":"checkForUpdatesAndNotify called, downloadPromise is null","timestamp":"2025-01-22T09:52:09.567Z"}
{"level":"info","message":"Downloading update from Karaoke Mugen-8.0.56-mac-x64.zip, Karaoke Mugen-8.0.56-mac-arm64.zip, Karaoke Mugen-8.0.56-mac-x64.dmg, Karaoke Mugen-8.0.56-mac-arm64.dmg","timestamp":"2025-01-22T09:52:12.623Z"}
{"level":"debug","message":"Checking for macOS Rosetta environment","timestamp":"2025-01-22T09:52:12.623Z"}
{"level":"info","message":"Checked for macOS Rosetta environment (isRosetta=false)","timestamp":"2025-01-22T09:52:12.625Z"}
{"level":"debug","message":"Checking for arm64 in uname","timestamp":"2025-01-22T09:52:12.625Z"}
{"level":"info","message":"Checked 'uname -a': arm64=true","timestamp":"2025-01-22T09:52:12.627Z"}
{"level":"debug","message":"updater cache dir: /Users/karaokemugen/Library/Caches/karaokemugen-app-updater","timestamp":"2025-01-22T09:52:12.627Z"}
{"level":"info","message":"Update has already been downloaded to /Users/karaokemugen/Library/Caches/karaokemugen-app-updater/pending/Karaoke Mugen-8.0.56-mac-arm64.zip).","timestamp":"2025-01-22T09:52:12.864Z"}
{"level":"debug","message":"Creating proxy server for native Squirrel.Mac (fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T09:52:12.864Z"}
{"level":"debug","message":"Proxy server for native Squirrel.Mac is created (fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T09:52:12.865Z"}
{"level":"debug","message":"Proxy server for native Squirrel.Mac is starting to listen (fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T09:52:12.865Z"}
{"level":"debug","message":"Proxy server for native Squirrel.Mac is listening (address=http://127.0.0.1:65523, fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T09:52:12.865Z"}
{"level":"info","message":"Update downloaded","service":"ElectronUpdater","timestamp":"2025-01-22T09:52:12.867Z"}
{"level":"info","message":"/ requested","timestamp":"2025-01-22T09:52:13.150Z"}
{"level":"info","message":"/51a29ce535b2a89188e9b83e9d3539d50e08a91a0b50f157fa843d1cecc85c831c0769f99f865457954c4ce260e96de48ce2d4dac8df47bd8945a3549d26185f.zip requested","timestamp":"2025-01-22T09:52:13.153Z"}
{"level":"info","message":"/51a29ce535b2a89188e9b83e9d3539d50e08a91a0b50f157fa843d1cecc85c831c0769f99f865457954c4ce260e96de48ce2d4dac8df47bd8945a3549d26185f.zip requested by Squirrel.Mac, pipe /Users/karaokemugen/Library/Caches/karaokemugen-app-updater/pending/Karaoke Mugen-8.0.56-mac-arm64.zip","timestamp":"2025-01-22T09:52:13.153Z"}
{"level":"debug","message":"nativeUpdater.update-downloaded","timestamp":"2025-01-22T09:52:16.712Z"}
{"level":"debug","message":"Closing proxy server","timestamp":"2025-01-22T09:52:20.210Z"}
{"level":"info","message":"Proxy server for native Squirrel.Mac is closed (fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T09:52:20.210Z"}
- Working (launched from terminal)
{"level":"debug","message":"checkForUpdatesAndNotify called, downloadPromise is null","timestamp":"2025-01-22T10:03:20.447Z"}
{"level":"info","message":"Downloading update from Karaoke Mugen-8.0.56-mac-x64.zip, Karaoke Mugen-8.0.56-mac-arm64.zip, Karaoke Mugen-8.0.56-mac-x64.dmg, Karaoke Mugen-8.0.56-mac-arm64.dmg","timestamp":"2025-01-22T10:03:26.094Z"}
{"level":"debug","message":"Checking for macOS Rosetta environment","timestamp":"2025-01-22T10:03:26.094Z"}
{"level":"info","message":"Checked for macOS Rosetta environment (isRosetta=false)","timestamp":"2025-01-22T10:03:26.098Z"}
{"level":"debug","message":"Checking for arm64 in uname","timestamp":"2025-01-22T10:03:26.098Z"}
{"level":"info","message":"Checked 'uname -a': arm64=true","timestamp":"2025-01-22T10:03:26.101Z"}
{"level":"debug","message":"updater cache dir: /Users/karaokemugen/Library/Caches/karaokemugen-app-updater","timestamp":"2025-01-22T10:03:26.101Z"}
{"level":"info","message":"Update has already been downloaded to /Users/karaokemugen/Library/Caches/karaokemugen-app-updater/pending/Karaoke Mugen-8.0.56-mac-arm64.zip).","timestamp":"2025-01-22T10:03:26.338Z"}
{"level":"debug","message":"Creating proxy server for native Squirrel.Mac (fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T10:03:26.339Z"}
{"level":"debug","message":"Proxy server for native Squirrel.Mac is created (fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T10:03:26.339Z"}
{"level":"debug","message":"Proxy server for native Squirrel.Mac is starting to listen (fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T10:03:26.339Z"}
{"level":"debug","message":"Proxy server for native Squirrel.Mac is listening (address=http://127.0.0.1:49208, fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T10:03:26.339Z"}
{"level":"info","message":"Update downloaded","service":"ElectronUpdater","timestamp":"2025-01-22T10:03:26.342Z"}
{"level":"info","message":"/ requested","timestamp":"2025-01-22T10:03:26.757Z"}
{"level":"info","message":"/cd71e37c3c3b6d2333830301a0f17fff98ca5365dc5d672dd70b01cbccc2a47d34340526e1103f67363f4760be237e3f76ca6eee2923d736e3d4e86b1767113f.zip requested","timestamp":"2025-01-22T10:03:26.759Z"}
{"level":"info","message":"/cd71e37c3c3b6d2333830301a0f17fff98ca5365dc5d672dd70b01cbccc2a47d34340526e1103f67363f4760be237e3f76ca6eee2923d736e3d4e86b1767113f.zip requested by Squirrel.Mac, pipe /Users/karaokemugen/Library/Caches/karaokemugen-app-updater/pending/Karaoke Mugen-8.0.56-mac-arm64.zip","timestamp":"2025-01-22T10:03:26.759Z"}
{"level":"debug","message":"nativeUpdater.update-downloaded","timestamp":"2025-01-22T10:03:35.259Z"}
{"level":"debug","message":"Closing proxy server","timestamp":"2025-01-22T10:03:35.259Z"}
{"level":"info","message":"Proxy server for native Squirrel.Mac is closed (fileToProxy=https://mugen.karaokes.moe/downloads/Karaoke%20Mugen-8.0.56-mac-arm64.zip)","timestamp":"2025-01-22T10:03:35.260Z"}
Note : another user tried this trick but it didn’t work for them.
Any help would be appreciated!
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 15 (8 by maintainers)
Hi team, just want to add another datapoint here. I was experiencing this with an electron app and realized that this was only the case when the application was in my macos Desktop folder. After moving it into my Documents folder, opening it either by double-clicking on the app or through the terminal would both properly update the version.
Would be great to figure out what we can do to resolve this for apps in the Desktop folder!
Hi, same issue here. The auto-update fails on macOS like described above, there’s no error message but the old version still starts.
However, the auto-update seems to be working reliably when you wait for about 5 seconds before closing the app after the new version has been downloaded and you wait for another 5 seconds before you start the app again. The correct new version started every time I tried it this way - but not if I waited not long enough either before closing or restarting the app. So it seems as if the installation process is aborted if the app is either closed too early or started again too soon.
Starting the app from the terminal doesn’t seem to make a difference in our case.
I tested it with electron-updater 6.3.9 and 6.5.0, the behavior is the same in both cases.