On Thursday, 26 November 2020 at 12:13:59 UTC, vnr wrote:
Hello,
I have a program written in D which is open-source on GitHub.
I would appreciate it if, when I release a new version, users
would be notified by the program and that it offers an
automatic update, i.e. the user doesn't have to reinstall the
whole repository himself, but that it is updated automatically.
I haven't found any packages that directly meet my needs, but
in the meantime I imagine that I will have to use the GitHub
API, as well as Curl to make such a system.
Do you have any resources or suggestions as to how I could
implement this? Thank you!
Make it a DUB package. It does not update 100% automatically, but
notifies when updates are available.
You could also make an auto-updater by hand, but that requires a
networking library and won't work anyway if the user does not
have permissions to change the executable. This is often the
case, as the often recommended places to store the programs are
`/usr/bin/` or `c:/program files/`. Neither is accessible by
default priviledges. In addition, it is a lot more work to
implement than making a dub package. I don't recomment absent a
strong reason.
If you publish your program in some other package format (apt,
rpm, flatpak or nix for example), you can try to get your package
into some official repository. There you can publish updates
easily, and the program gets updated among the regular software
updates the users do.