Updater Library

Updater Library

The Updater Library is the library we use to provide automatic updates to users of all of our applications. It's currently in-use in both Decoda and the Natural Selection 2 tools alpha.

In addition to handling patches, the Updater Library also includes functionality to send exception/crash and other types of reports.

The Updater Library can be used in a number of different ways; synchronous or asynchronous, and with the built in UI or a custom GUI.

Basic usage:

const unsigned int buildNumber = 100;
const char* buildsUrl = "http://www.unknownworlds.com/builds.xml";

Updater updater;

if (updater.CheckForUpdates(buildsUrl, buildNumber, NULL)) {

if (updater.ShowUpdateNotice(NULL)) { if (!updater.DownloadUpdate(NULL)) { printf("Error downloading update"); return; }

if (!updater.InstallUpdate()) { printf("Error running installer"); return; } else { // Terminate the process so the updater will start. exit(0); }

}

}

The Updater downloads an XML file from a server to get information about the builds and patches available.