Condividi tramite


How to: Configure the Add-In Package to be Updated or Renewed

 

Applies To: Windows Server 2012 Essentials, Windows Home Server 2011, Windows Storage Server 2008 R2 Essentials, Windows Small Business Server 2011 Essentials

You can configure your add-in package to be updated or renewed by using the AddInManager class.

To configure your add-in package to be updated

  1. Write the code to determine when an update for your add-in package is available. For example, you can query a Web page.

  2. When an update is available, call the following code as an administrator on the server:

    AddInManager om = new AddInManager();  
    om.NewAddInVersionAvailable(<GUID>, <Version>, <AddInAddress>, <UpdateClassification>);  
    

    The following table lists the arguments that are passed to the NewAddInVersionAvailable method.

    Argument Description
    <GUID> The unique identifier of the add-in package.
    <Version> The version of the add-in package.
    <AddInAddress> The Uri that contains the address of the add-in package.
    <UpdateClassification> A value from the UpdateClassification enumeration, which indicates the type of updates that can be applied to an add-in package. The value can be CriticalUpdate, ImportantUpdate, Update, or Unknown.

To configure your add-in package to be renewed

  1. Write the code to determine when the subscription must be renewed for your add-in package.

  2. When an expiration date is known, call the following code as an administrator on the server:

    AddInManager om = new AddInManager();  
    om.SetAddInExpirationDate(<GUID>, <UTCExpirationDate>, <RenewalAddress>);  
    

    The following table lists the arguments that are passed to the SetAddInExpirationDate method.

    Argument Description
    <GUID> The unique identifier of the add-in package.
    <UTCExpirationDate> The time that the add-in package expires. DateTime.MaxValue can be used if the add-in package does not expire.
    <RenewalAddress> The Url where the add-in package can be renewed.