mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2025-01-22 07:21:13 +00:00
Update the README file.
* Re-organize the sections into a more logical order. * Tidy-up the wording of the introduction. * Add more details to the section on customizing the updater
This commit is contained in:
parent
e9c94e99ad
commit
29ba43be7c
1 changed files with 81 additions and 35 deletions
112
README
112
README
|
@ -2,35 +2,33 @@ This tool is a component of a cross-platform auto-update system.
|
||||||
It is responsible for performing the installation of an update after
|
It is responsible for performing the installation of an update after
|
||||||
the necessary files have been downloaded to a temporary directory.
|
the necessary files have been downloaded to a temporary directory.
|
||||||
|
|
||||||
This tool is responsible for:
|
It was originally written for use with Mendeley Desktop (see www.mendeley.com)
|
||||||
|
|
||||||
* Reading an XML file specifying the contents of an update.
|
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')
|
||||||
* Extracting and installing updated files from one or more compressed packages.
|
and a tool to create update scripts from a directory containing an installed application.
|
||||||
|
|
||||||
* Removing any files which are no longer needed in the new version of the application.
|
|
||||||
|
|
||||||
* Requesting elevated priviledges if required to install the update.
|
|
||||||
|
|
||||||
* Displaying a simple updater UI and re-launching the main application
|
|
||||||
once the update is installed.
|
|
||||||
|
|
||||||
The tool consists of a single small binary which depends only on libraries
|
|
||||||
that are part of the base system.
|
|
||||||
|
|
||||||
The external dependencies of the updater binary are:
|
|
||||||
|
|
||||||
* The C/C++ runtime libraries (Linux, Mac),
|
|
||||||
* pthreads (Linux, Mac),
|
|
||||||
* zlib (Linux, Mac)
|
|
||||||
* native UI library (Win32 API on Windows, Cocoa on Mac, GTK on Linux if available)
|
|
||||||
|
|
||||||
To perform an update, the application (or another separate tool) needs to download
|
To perform an update, the application (or another separate tool) needs to download
|
||||||
the updater binary, an XML file describing the update and one or more zip packages
|
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
|
containing the files for the update to a temporary directory. It then needs
|
||||||
to invoke the updater, specifying the installation directory, temporary package
|
to invoke the updater, specifying the location where the application is installed,
|
||||||
directory and path to the update script file. The updater then installs the
|
the location of the compressed packages and the path to the update script.
|
||||||
update and restarts the application when done.
|
|
||||||
|
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
|
Building the Updater
|
||||||
====================
|
====================
|
||||||
|
@ -40,17 +38,16 @@ Building the Updater
|
||||||
cmake <path to source directory>
|
cmake <path to source directory>
|
||||||
make
|
make
|
||||||
|
|
||||||
Customizing the Updater
|
The updater binary will be built in the src/ directory.
|
||||||
=======================
|
|
||||||
|
|
||||||
To customize the application name, organization and messages displayed by the updater,
|
You should also run the tests in src/tests to verify that the updater is
|
||||||
edit the AppInfo class and the icons in src/resources
|
functioning correctly.
|
||||||
|
|
||||||
Preparing an Update
|
Preparing an Update
|
||||||
===================
|
===================
|
||||||
|
|
||||||
1. Create a directory containing your application's files,
|
1. Create a directory containing your application's files,
|
||||||
laid out and with the same permissions as they would be when installed.
|
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
|
2. Create a config file specifying how the application's files should be
|
||||||
partitioned into packages - see tools/config-template.json
|
partitioned into packages - see tools/config-template.json
|
||||||
|
@ -65,14 +62,63 @@ Preparing an Update
|
||||||
relevant packages, file_list.xml file and updater binary to a temporary
|
relevant packages, file_list.xml file and updater binary to a temporary
|
||||||
directory and invoke the updater.
|
directory and invoke the updater.
|
||||||
|
|
||||||
Delta Updates
|
Invoking the Updater
|
||||||
=============
|
====================
|
||||||
|
|
||||||
The simplest possible auto-update implementation is for existing installs
|
Once the application has downloaded an update, it needs to invoke it. The syntax is:
|
||||||
|
|
||||||
|
updater --install-dir <install-dir> --package-dir <package-dir> --script <script file>
|
||||||
|
|
||||||
|
Where <install-dir> is the directory which the application is installed into,
|
||||||
|
<package-dir> is the directory containing the packages required for the update
|
||||||
|
and <script> is the file_list.xml file describing the update.
|
||||||
|
|
||||||
|
Once the updater has run, it will launch the file specified in the file_list.xml file
|
||||||
|
as being the main application binary.
|
||||||
|
|
||||||
|
See the updater test in src/tests/test-update.rb for an example
|
||||||
|
of how to invoke the updater.
|
||||||
|
|
||||||
|
You should design the process used to download and launch the updater so that new
|
||||||
|
versions of the updater itself can be delivered as part of the update if necessary.
|
||||||
|
|
||||||
|
Customizing the Updater
|
||||||
|
=======================
|
||||||
|
|
||||||
|
To customize the application name, organization and messages displayed by the updater:
|
||||||
|
|
||||||
|
1. Edit the AppInfo class (in AppInfo.h, AppInfo.cpp) to set the name
|
||||||
|
of the application and associated organization.
|
||||||
|
|
||||||
|
2. Replace the icons in src/resources
|
||||||
|
|
||||||
|
3. Change the product name and organization in src/resources/updater.rc
|
||||||
|
|
||||||
|
4. If you are building the updater on Windows and have a suitable Authenticode
|
||||||
|
certificate, use it to sign the Windows binary. This will make the application
|
||||||
|
show a less scary UAC prompt if administrator permissions are required
|
||||||
|
to complete the installation.
|
||||||
|
|
||||||
|
Updater Dependencies
|
||||||
|
====================
|
||||||
|
The external dependencies of the updater binary are:
|
||||||
|
|
||||||
|
* The C/C++ runtime libraries (Linux, Mac),
|
||||||
|
* pthreads (Linux, Mac),
|
||||||
|
* zlib (Linux, Mac)
|
||||||
|
* native UI library (Win32 API on Windows, Cocoa on Mac, GTK on Linux if available)
|
||||||
|
|
||||||
|
Full and Delta Updates
|
||||||
|
======================
|
||||||
|
|
||||||
|
The simplest auto-update implementation is for existing installs
|
||||||
to download a complete copy of the new version and install it. This is
|
to download a complete copy of the new version and install it. This is
|
||||||
appropriate if a full download and install will not take a long time for most users
|
appropriate if a full download and install will not take a long time for most users
|
||||||
(eg. if the application is small or they have a fast internet connection).
|
(eg. if the application is small or they have a fast internet connection).
|
||||||
|
|
||||||
|
With this tool, a full-update involves putting all files in a build of
|
||||||
|
the application into a single package.
|
||||||
|
|
||||||
To reduce the download size, delta updates can be created which only include
|
To reduce the download size, delta updates can be created which only include
|
||||||
the necessary files or components to update from the old to the new version.
|
the necessary files or components to update from the old to the new version.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue