Class MicrosoftUpdatePackage
A base class for all updates stored on an upstream Microsoft Update server.
Stores generic update metadata applicable to both categories (classifications, products, detectoids) and updates (software and driver updates).
Inheritance
Implements
Namespace: Microsoft.PackageGraph.MicrosoftUpdate.Metadata
Assembly: package-graph-microsoft-update.dll
Syntax
public abstract class MicrosoftUpdatePackage : IPackage
Properties
| Improve this Doc View SourceApplicabilityRules
Gets the applicability rules for an update
Declaration
public List<ApplicabilityRule> ApplicabilityRules { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<ApplicabilityRule> |
Categories
The list of category IDs associated to this update
Declaration
public IReadOnlyList<Guid> Categories { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyList<System.Guid> |
Description
Get the category or update description
Declaration
[JsonProperty]
public string Description { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Files
Gets the list of files (content) for update
Declaration
public IEnumerable<IContentFile> Files { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IContentFile> | List of content files |
Handler
Gets the handler that can apply this update to a Windows device
Declaration
public HandlerMetadata Handler { get; }
Property Value
| Type | Description |
|---|---|
| HandlerMetadata |
Id
Returns the identity of this Microsoft Update package
Declaration
public MicrosoftUpdatePackageIdentity Id { get; }
Property Value
| Type | Description |
|---|---|
| MicrosoftUpdatePackageIdentity |
Prerequisites
Get the list of prerequisites
Declaration
public List<IPrerequisite> Prerequisites { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<IPrerequisite> | List of prerequisites |
Title
Get the category or update title
Declaration
public string Title { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceFromMetadataXml(Byte[], Dictionary<String, UpdateFileUrl>)
Creates a MicrosoftUpdatePackage from raw metadata and a list of content files associated with the package
Declaration
public static MicrosoftUpdatePackage FromMetadataXml(byte[] metadata, Dictionary<string, UpdateFileUrl> filesCollection)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | metadata | RAW metadata. Expected to be UTF8 encoded XML |
| System.Collections.Generic.Dictionary<System.String, UpdateFileUrl> | filesCollection | List of URLs for content files |
Returns
| Type | Description |
|---|---|
| MicrosoftUpdatePackage | Rehydrated MicrosoftUpdatePackage object |
GetCategories(ILookup<Guid, MicrosoftUpdatePackage>)
The list of categories associated with this update.
Declaration
public List<MicrosoftUpdatePackage> GetCategories(ILookup<Guid, MicrosoftUpdatePackage> knownCategories)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.ILookup<System.Guid, MicrosoftUpdatePackage> | knownCategories | List of known categories. The updates's category IDs will be resolved from this list. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<MicrosoftUpdatePackage> | List of categories for the update |
GetMetadataStream()
Returns the XML metadata stream from which this update metadata was created.
Declaration
public Stream GetMetadataStream()
Returns
| Type | Description |
|---|---|
| System.IO.Stream | XML stream, UTF8 encoded |
IsApplicable(List<Guid>)
Determines if the update is applicable based on its list of prerequisites and the list of installed updates (prerequisites) on a computer
Declaration
public bool IsApplicable(List<Guid> installedPrerequisites)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<System.Guid> | installedPrerequisites | List of installed updates on a computer |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if all prerequisites are met, false otherwise |
MatchTitle(String[])
Matches keywords in the title of the update
Declaration
public bool MatchTitle(string[] keywords)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | keywords | List of keywords to match. All keywords must match |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if all keywords match, false otherwise. |
ReleaseMetadataBytes()
Releases raw metadata cached in memory.
Declaration
public void ReleaseMetadataBytes()
Explicit Interface Implementations
| Improve this Doc View SourceIPackage.Id
Returns the identity of this Microsoft Update package
Declaration
IPackageIdentity IPackage.Id { get; }
Returns
| Type | Description |
|---|---|
| IPackageIdentity |