My intention here is to start a discussion about how to implement auto-updater support for MacOS and eventually Linux.
What changes need to be done in order for this work?
latest.yml changes
I would suggest adapting a new format similar to this. The generation of this file would also need to be moved to outside of the targets/nsis.ts to somewhere more appropriate for handling multiple platforms.
Actual update process
I dont see any reason for the check-updates/download process to change much, the downloading should work fine across platforms, and app-update.yml should only contain details for the current platform. _Actually installing the update is something I'm not clear about how that is achieved on MacOS?_ perhaps a shell script that replaces the contents of the Applications/MyApp with the zip contents?
Any other points/suggestions?
Solution from https://github.com/megahertz/electron-simple-updater will be merged into electron-auto-updater.
I'm not clear about how that is achieved on MacOS? perhaps a shell script that replaces the contents of the Applications/MyApp with the zip contents?
Squirrel.Mac will be not replaced. "Hack" to avoid extra server just applied.
When it will be done? I hope this weekend.
@badams If you can help to merge macOS solution from https://github.com/megahertz/electron-simple-updater — it will be cool.
Ok — I started to work on it.
For macOS postfix -mac will be used. i.e. in addition to latest.yml for windows, file latest-mac.yml will be generated (here latest it is channel name (supported by generic provider)).
Also, file latest-mac.json will be generated and uploaded for Squirrel.Mac (content: {"url": "actual mac-zip url"}). No way to avoid such file. In any case electron-builder will generate and upload it for you.
@develar sorry I haven't had a lot of time to get on github - Thanks for putting this together! :)
Do windows and linux allow for serverless updates?
@amilajack Yes, on windows you can use Github, Bintray or any generic http server (e.g. amazon s3, https included). On Linux auto-update not yet implemented.
@develar I am trying to test your dev on this.
I am using generic as a publish provider. How will it work? i don't see any latest.yml being generated.
Thanks
@farfromrefug If you brave enough, you can test, but don't expect that it will work.
How will it work? i don't see any latest.yml being generated.
We don't generate latest.yml — latest-mac.json is generated. Why JSON? Because this file is used as release.json file for Squirrel.Mac.
Also, please note — electron-auto-updater is not yet published — you need to use it from source (or link / or publish for you).
All required changes on electron-builder is available in the electron-builder 11.2.5.
@develar sure i am willing :D and i know it's in dev. I though a mentin about that json file, but i don't see it either. I have gone through the macPackager.ts but i don't see any mention of it
Will switch to github builds for electron-builder and electron-auto-updater, and see what i can find
Thanks
I have gone through the macPackager.ts but i don't see any mention of it
@farfromrefug Do you build dmg? File will be generated only if zip target presented (default target for mac is dmg + zip.
i don't see it either
In the dist directory.
Ok that s what i thought, but the publishManager is not created using generic.
Yes i am building a zip
@farfromrefug Ouch, I got what do you mean. Well, please try to use 11.2.4 (should generates the same file). Thank you! It is "regression" in the latest release. Or use --publish=always (maybe it help).
ok will do. --publish=always won't help as you check for authentication after that
@farfromrefug latest-mac.json generation fixed in 11.2.6.
It works. Really. No more special server for macOS updates. It will be released in 2 days (depends on my free time), because auto-update on windows should be checked manually (to avoid any regressions).
Awesome work @develar! I will do some testing too when I get time
Miracles happens. Serverless macOS auto-update is implemented in the electron-builder 11.3.0 and electron-auto-updater 1.0.0 Enjoy. It is not yet polished, but works.
Thanks to @megahertz for the idea.
@develar Actually it's not my idea. But unfortunately, I don't remember where I've found it.
@develar there is an issue with the name of zip file created while packaging and the zip path contained in the latest-mac.json.
in the json you use productName
while as in packaging you use name.
In my case productFilename and name are not the same (but i think it is the case for any app)
@farfromrefug It is because you use generic provider. Yes, due to silly GitHub restrictions and Squirrel.Mac bug (cannot use relative path) we must generate special latest-mac.json for GitHub.
@develar ok so what's the solution here? Wouldn't it be a good solution to name the zip with name instead of productName?
@farfromrefug Solution is to generate file for GitHub in the github directory.
Wouldn't it be a good solution to name the zip with name instead of productName?
Yes, it is another variant. But sometimes user expect product name here as well.
PR is welcome or I will address it in 2 days somehow.
@develar i totally understand. And i guess you are right. People do expect productName. Even i expect it ;)
I think the best solution for now is to rename the file afterwards. It's really easy for me as i use gulp with your API
Will report more on the whole update process. Thanks for your amazing work!
@farfromrefug Fixed in 11.4.2 — GitHub file in the github directory.
electron-auto-updater renamed to electron-updater
Most helpful comment
It works. Really. No more special server for macOS updates. It will be released in 2 days (depends on my free time), because auto-update on windows should be checked manually (to avoid any regressions).