The Kinetic Jump site navigation header requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

Welcome Guest Search | Active Topics | Log In | Register

Intervene during a Check for Update and control which update is found Options
brianh
#1 Posted : Monday, November 26, 2007 7:38:40 AM
Rank: Administration
Groups: Member, Administration

Joined: 5/24/2007
Posts: 362
Location: Minnesota

The Update Controller has an UpdateFound event that is raised any time an update is found.  The event arg of this event includes a list of all available updates for the current client version.  From the items in this list, you can interogate all of the information that is contained in the Director about each of the versions.  This includes the custom data information for each update.

 

Using this information, and any other information about your application that you can access from this event handler, you can make decisions on whether to allow the highest discovered update, make available an earlier update, or even make no update available.

 

For example.  If you wanted to apply a rule that only updates that matched the current clients major version to be discoverable, you could achieve this with the following event handler:

 

 

void mUpdateController_UpdateFound(object sender, Kjs.AppLife.Update.Controller.UpdateFoundEventArgs e) {

  //If the Major version of the update that was

  //found is greater than the current version, then

  //don’t allow the update.  Instead, look for any

  //available updates with the same Major version.

  

  if(e.SelectedUpdate.Version.Major > mUpdateController.Version.Major) {

    //the newest update we cant use.  See if we can find one

    //we can apply

    e.SelectedUpdate = null;

       

    foreach(UpdateInformation update in e.AvailableUpdates) {

      if(update.Version.Major == mUpdateController.Version.Major) {

        e.SelectedUpdate = update;

        break;

      }

        

      if(e.SelectedUpdate == null) {

      

      //None is availabe.  Perhaps show a message indicating

      //that an upgrade is availabe.

      }

    }                                  

  }

}

Brian Haas
Kinetic Jump Software
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.