The AppLife Update Engine

When the Update Engine is executed on the client computer, the downloaded update package is parsed to determine the actions that should be executed on the client computer.  The Update Engine performs the update in a three stage operation.

      Prepare

      Execute

      Cleanup

Each update action contained in the update package defines methods for each stage the engine executes, as well as a rollback method should an unexpected exception occur during the update process.  The engine first iterates the action list, calling the Prepare method on each action.  Within the prepare method, each action perform any preparatory and backup activity necessary.  Backup activity is performed to facilitate rolling back the state of the client to its initial pre-update state.

Upon successful completion of the Prepare stage, the engine starts over and iterates each action calling the Execute method.  Within this method the action performs the update steps.  Any activity that must be completed for this update to be successful is performed in the Execute stage.  When this stage is completed for all the actions in the update package, the client software is considered updated.  Any unexpected exception that occurs prior to completing the Execute stage on all actions will cause the engine to enter into a Rollback process.  If the Execute stage completes successfully, the engine moves on to the Cleanup stage.

The Cleanup stage is for removing any temporary files, logging custom activity, or tidying up behind the process.  There are no activities critical to the success of the update occurring in this stage.  If an unexpected exception occurs in this stage, the stage is aborted, but a complete rollback will not occur.  In this event the software is considered successfully updated, but there might be files left in the user’s temporary directory.

In the event of an exception that causes a rollback, the engine starts at the current action and iterates in the reverse order.  Each action executes its defined rollback activity.  When the rollback process completes, the client software should be back to the same state that existed before executing the update.

Each update package is self-contained and includes the update engine.