electronelectron-builderelectron-updatergithub-release

How is electron-updater able to find my repository?


I have a repository that utilizes electron-updater for auto update. The weird thing is, it has no any code whatsoever pointing where the release updates are stored (I store it in GitHub releases), but somehow the autoUpdater.checkForUpdatesAndNotify() still works. There is github remote origin but I doubt it's being used by electron-updater to find the repository. I don't use any GitHub token either.

The way I release update:

It's worth mentioning that if latest-linux.yml is missing from the latest release's asset, it will throw 404 error and refuse to update despite knowing the latest version's tag.

Here's the repository I'm talking about: https://github.com/SnekNOTSnake/fresh-update/releases

Also, is this how normal people release their electron app? I tried the electron-builder --publish way, but it's troublesome compared to the manual steps above.


Solution

  • Thanks to Caramiriel in the comment section above for the enlightenment.

    How electron-updater knows where to find the repository is from resources/app-update.yml inside the produced .AppImage file.

    The app-update.yml file is produced by electron-builder using the information from git remote get-url origin (if available).

    I proved it by changing the origin's url to https://github.com/SnekNOTSnake/tofu-tracker.git and build the AppImage, and (surprisingly enough) the repo's value became tofu-tracker.