This tool is a component of a cross-platform auto-update system. It is responsible for performing the installation of an update after the necessary files have been downloaded to a temporary directory. It was originally written for use with Mendeley Desktop (see www.mendeley.com) The tool consists of a single small binary which performs update installation, an XML file format describing the contents of an update (an 'update script') and a tool to create update scripts from a directory containing an installed application. To perform an update, the application (or another separate tool) needs to download the updater binary, an update script and one or more compressed packages containing the files for the update to a temporary directory. It then needs to invoke the updater, specifying the location where the application is installed, the location of the compressed packages and the path to the update script. Once the updater has been started, it: 1. Waits for the application to exit 2. Acquires the necessary priviledges to install the updates, prompting the user if necessary. 3. Installs the updates, displaying progress to the user in a small dialog 4. Performs cleanup and any additional actions required as part of the update 5. Starts the new version of the main application. In the event of a failure during the update, the installation is rolled back to its previous state and a message is presented to the user. Building the Updater ==================== Create a new directory for the build and from that directory run: cmake make The updater binary will be built in the src/ directory. You should also run the tests in src/tests to verify that the updater is functioning correctly. Preparing an Update =================== 1. Create a directory containing your application's files, laid out in the same way and with the same permissions as they would be when installed. 2. Create a config file specifying how the application's files should be partitioned into packages - see tools/config-template.json 3. Use the tools/create-packages.rb script to create a file_list.xml file and a set of package files required for updates. 4. Upload the file_list.xml file and packages to a server After step 4 is done, you need to notify existing installs that an update is available. The installed application then needs to download the relevant packages, file_list.xml file and updater binary to a temporary directory and invoke the updater. See doc/update-hosting for more details on hosting and delivering the updates. Invoking the Updater ==================== Once the application has downloaded an update, it needs to invoke it. The syntax is: updater --install-dir --package-dir --script