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

Integrate License Checking Into an Update Process Options
brianh
#1 Posted : Monday, July 02, 2007 12:28:21 PM
Rank: Administration
Groups: Member, Administration

Joined: 5/24/2007
Posts: 362
Location: Minnesota
There are a couple of ways that you might integrate license checking into an update process.

If you are using the UpdateInteractive() method to check for updates, the best way to integrate license checking is to subscribe to the UpdateFound event. Within the UpdateFound event, you have access to not only the update that was found, but also a collection of all possible updates that the client could be updated to. You can perform whatever license check you need to, and based on that check, you can deny an update by setting the SelectedUpdate property of the event argument to null or nothing. You could also choose to set the SelectedUpdate property to an earlier update version that the user is licensed to apply.

You could also choose not to use UpdateInteractive and instead use either CheckForUpdate or CheckForUpdateAsync to perform an update check. If you do this, you can perform your license checks before the udpate check or after. After the update check, you have access to the current update information. You could still use the standard download form to display download progress after the custom check for update call.

Here is an example of how to use composite calls to emulate the same process that UpdateInteractive() performs

C#
Code:
//This code replaces the updateController1.UpdateInteractive(this); call
            
if(DialogResult.OK == updateController1.ShowCheckForUpdateDialog(this)) {
  //there is an update availabe and the user asked to get it.
  //You can check out the update properties, custom data, etc.
  //Any download method could be used to download the update.
  if(DialogResult.OK == updateController1.ShowDownloadUpdateDialog(this)){
    //The update has been downloaded.
    //updateController1.CurrentUpdate.IsDownloaded will be true now.
    //We can apply the update now, or later.
    updateController1.ApplyUpdate();
  }
}


VB
Code:
'This code replaces the Me.updateController1.UpdateInteractive(Me) call

If updateController1.ShowCheckForUpdateDialog(Me) = DialogResult.OK Then
  'there is an update availabe and the user asked to get it.
  'You can check out the update properties, custom data, etc.
  'Any download method could be used to download the update.
  If updateController1.ShowDownloadUpdateDialog(Me) = DialogResult.OK Then
    'The update has been downloaded.
    'updateController1.CurrentUpdate.IsDownloaded will be true now.
    'We can apply the update now, or later.
    updateController1.ApplyUpdate()
  End If
End If


Also, if you are using the standard check for updates form and you want to set the summary text shown on the form based on your license check, you can subscribe to the UpdateDialogShowing event and change the summary text by setting the DialogSummaryText value of the event argument.
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.