Skip to content

Self updating AppImages

TheAssassin edited this page Oct 26, 2017 · 7 revisions

Many users of AppImage requested a feature other software distribution systems have had for many years: An app should be able to update itself. Therefore, the new AppImageUpdate implementation (written in C++11, using FLTK) provides a method that can be used to update the current AppImage.

This functionality is exposed from an application with the bulky name appimageupdategui-selfupdate. The app reads meta information from the environment, and can update the current AppImage automatically. When the update is finished, it automatically executes the new AppImage.

The new AppImage process is further started with some environment variables indicating that AppImageUpdate has just been run. Hence, any automatic update checks on start can be deactivated to provide faster start-up.

  • STARTED_BY_APPIMAGEUPDATE=1: The existence of this variable indicates that AppImageUpdate has started the AppImage. The value is set to 1 by default, but it shall be enough to check for the variable's existence and not the value.

Automatically self-updating AppImages

Another feature requested frequently is being able to make an AppImage look for updates automatically, and call AppImageUpdate before the actual application startup to make sure users are always on the latest version.

This feature is being worked on at the moment. Users of this feature are encouraged not to just update, but rather show a message to the user that an update is available.

The reference implementation will meet the following requirements:

  • efficient and reliable update check
  • require user consent before performing any updates
  • ask user on first application run whether to check for updates or not
    • depending on the update information type, services like GitHub, Bintray etc. might be queried on a regular base, which is not comfortable for some users
    • update checks might consume a lot of data, which is a problem for users of mobile data contracts
      • Red Eclipse .zsync files for example consume around 1.6-1.8 MiB
      • TODO: when using MTime: header field based update check method, make sure to close connection after header fields and skip downloading the hashes
Clone this wiki locally