Patching System

The Tonido framework contains a flexible patching system for patching the application as well as any installed plugins. A check for new updates is done at startup if a specified time period has passed since the last check for update was done.

Some of the features of the patching system:

The patching system handles two different sets of packages.

System package contains the executable files, the bootstrap/core dlls, thirdparty dlls and other data files. It also includes the launcher executable.

Plugin Package is per application plugin and comprises of the main plugin shared library and any required files.

Manifest

Patch Maker

System Patching

The following happens when the application comes up:

  1. The patcher system checks for a file called lastchecked. It then examines the created date of that file. If the file is less than 24 hours old (currently), it will skip patching and exit.
  2. If the lastchecked file is not present or older than 24 hours, the manifest.xml file is opened and the base URL is examined. (The old lastpatched file is deleted)
  3. It first downloads the latest version of the manifest.xml from the URL
  4. Next for every file in the manifest.xml it checks the local file. If the MD5 of the local file matches the hash in the manifest it continues to the next file.
  5. Otherwise, it will check if there is cached download with the name 'filename.rep'. if the file exists with the correct MD5 it will continue to the next file
  6. If both conditions fail, it will do a HTTP download of the file from the base download URL. Note that the file is in the GZIP format. Once downloaded, it will be expanded to the filename.rep format.
  7. After all files are done and if any files were patched, it will create the lastchecked file and also create a 'doupdate' file and it will signal the application to terminate. Before terminating, it will launch the launcher application.

The following happens when the launcher comes up:

  1. The launcher application is a small executable having no thirdparty dependencies that is meant to update the system files. This is required because an application cannot replace its own dll and exe files when it is running.
  2. The launcher checks if a 'doupdate' file exists.
  3. If it exists, it will move the filename.rep files to filename and then launches the p2p app.
  4. If it doesn't exist, it will simply launch the Tonido app

Plugin Patching

Plugin patching is similar to System patching except that the application will not be restarted if a plugin needs to be updated.


Generated on Wed Oct 12 2011 21:46:52. © CodeLathe LLC 2007-2011. All Rights Reserved.