How should I implement an auto-updater?

后端 未结 16 1110
名媛妹妹
名媛妹妹 2020-12-04 06:11

Many programs include an auto-updater, where the program occasionally looks online for updates, and then downloads and applies any updates that are found. Program bugs are f

相关标签:
16条回答
  • 2020-12-04 06:33

    If you are searching for an cross-platform software update solution, take a look at www.updatenode.com

    Some highlights:

    • free for Open Source projects
    • cross-platform & Open Source update client tool
    • localized already for the most important languages
    • easy to integrate and easy to handle
    • cloud based management platform to define and manage updates
    • provides additionally support for displaying messages (inform about new events, products, etc.)
    • web interface is open (you can create your own client using the service)
    • many usage statistics, as used operating systems, geo location, version usage, etc.
    • Android API for mobile App updates

    Just try it.

    BTW, I am part of the dev team for the open source client. :)

    0 讨论(0)
  • 2020-12-04 06:37

    This is not so much a complete answer, but rather one example of auto-updating mechanism I implemented recently. The situation is a little different from the tradition Firefox-type of user application, since it was an internal tool used at work.

    Basically, it's a little script that manages a queue of Subversion branches to be built and packaged in an installer. It reads a little file, where the names of the branches are written, takes the first one, re-writes it at the end of the file, and launches the build process, which involves calling a bunch of scripts. The configuration for each branch to build is written in a .INI file, stored in a Subversion repository along with the tool itself.

    Because this tool runs on several computers, I wanted a way to update it automatically on all machines as soon as I made a change either to the tool itself, or to the configuration scripts.

    The way I implemented it was simple: when I launch the tool, it becomes an "outer shell". This outer shell does 2 very simple things:

    • svn update on itself and on the configuration files
    • launch itself again, this time as the "inner shell", the one that actually handles one configuration (and then exits again).

    This very simple update-myself-in-a-loop system has served us very well for a few months now. It's very elegant, because it is self-contained: the auto-updater is the program itself. Because "outer shell" (the auto-updater part) is so simple, it doesn't matter that it does not benefit from the updates as the "inner shell" (which gets executed from the updated source file every time).

    0 讨论(0)
  • 2020-12-04 06:37

    If your software is open sourced, and target Linux or developers. It is interesting to install your software as a git repo. And having it pull the stable branch occasionally or everytime when it is launched.

    This is particular easy when your application is managed via npm, sbt, mavan, stack, elm-package or alike.

    0 讨论(0)
  • 2020-12-04 06:38

    You can use my solution (part of the Target Eye project). http://www.codeproject.com/Articles/310530/Target-Eye-Revealed-part-Target-Eyes-Unique-Auto

    0 讨论(0)
提交回复
热议问题