Conveyor updates for August

The latest Conveyor update adds delta updates for macOS, lets you migrate your update site URL, has a new tutorial on how to use HOCON and updates to the latest version of the Apple notarization protocol. Let’s take it for a test drive!

Binary deltas encode the differences between two versions of an app, so by using them you can avoid sending the entire app to the user when it’s time to upgrade. Here’s a demo of the update process both with and without delta updates. It’s on a 50Mbit/sec connection and the app is simply the Electron template app you get by running conveyor generate electron hello-world:

With deltas the app is upgraded nearly instantly. The other is still downloading by the time the first user is already back to work.

A better workflow

The Sparkle library that is bundled into your app when shipping to macOS has supported delta updates for while, but the workflow for creating them could be awkward when using the native upstream tools. You’re expected to keep all the needed app versions around locally, and use a program written in Objective-C. That isn’t ideal when working with continuous integration, when shipping from non-macOS machines or when multiple people can do releases.

Conveyor 11 now makes this whole process automatic. Just ensure that you set conveyor.compatibility-level to 11 or higher and run make site or make copied-site as normal. Conveyor will download prior releases, compute deltas from them and then include those delta files in your appcasts. Sparkle will use the delta if it can or fall back to the full download if it can’t (e.g. if the user edited their install). If you want to adjust the number of deltas that are computed you can set app.mac.deltas to the number of versions you prefer (or zero to disable). Existing installs have supported applying deltas from day one, so you’ll see the benefits immediately.

Like with everything else in Conveyor you can do this from any platform: builds run on Linux or Windows can generate deltas for macOS. It generates the deltas itself without any Mac-specific tooling.

You also don’t have to manage a collection of old versions. The metadata.properties file that is generated alongside the other update system metadata files contains the version numbers and hashes of older releases. These are then downloaded from your update site and stored in the disk cache. If your cache is big enough and preserved between releases the older versions may even still be there and thus no downloads are necessary. This scheme frees you from manually managing a collection of old versions.

Behind the scenes a Sparkle delta update is a collection of instructions to move/add/delete files, change permissions, set symlinks and of course, compute new versions from old versions using the popular “bsdiff” format. Although Conveyor computes binary deltas in parallel Sparkle applies them serially. As can be seen from the video, with a fast enough internet connection the process of applying the patch can take longer than downloading it. Optimizing the patch application process might be an interesting project for the future.

Migrating your site URL

Most software update systems come from large companies and thus assume long-term stable URLs are a given. In the wider world companies change names, get acquired, move to different hosting providers and so on. In Conveyor 11 it’s now possible to migrate your update site to a different URL. For a period of your choosing Conveyor will upload files to both old and new site URLs, with the old site pointing to the binaries on the new. As users upgrade the software update configuration will be updated to point to the new location. Eventually you can stop putting files at the old URL and delete it.

Minor improvements

Apple now has an officially supported notarization API meant specifically for tools like Conveyor. The main difference is that authentication is done using private keys instead of API keys. We’ve added support for using it and updated the docs to point new users at it, but don’t worry, if you already have macOS notarization set up then you don’t need to make any changes. The old method continues to work fine.

Finally, we’ve made some bug fixes and usability improvements. For example, more defaults are now inferred from your code signing certificates, if you have any.

You can upgrade by starting the app and clicking “Check for upgrades”.

.