Version: v0.11.22 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 5 Imported by: 0



Package windowsupdate provides a go-ole interface to the windows update agent.

This code derives from



This section is empty.


This section is empty.


This section is empty.


type ICategory

type ICategory struct {
	CategoryID  string
	Children    []*ICategory
	Description string
	Image       *IImageInformation
	Name        string
	Order       int32
	Parent      *ICategory
	Type        string
	Updates     []*IUpdate
	// contains filtered or unexported fields

ICategory represents the category to which an update belongs.

type IImageInformation

type IImageInformation struct {
	AltText string
	Height  int64
	Source  string
	Width   int64
	// contains filtered or unexported fields

IImageInformation contains information about a localized image that is associated with an update or a category.

type IInstallationBehavior

type IInstallationBehavior struct {
	CanRequestUserInput         bool
	Impact                      int32 // enum
	RebootBehavior              int32 // enum
	RequiresNetworkConnectivity bool
	// contains filtered or unexported fields

IInstallationBehavior represents the installation and uninstallation options of an update.

type ISearchResult

type ISearchResult struct {
	ResultCode     int32 // enum
	RootCategories []*ICategory
	Updates        []*IUpdate
	Warnings       []*IUpdateException
	// contains filtered or unexported fields

ISearchResult represents the result of a search.

type IUpdate

type IUpdate struct {
	AutoDownload                    int32 // enum
	AutoSelection                   int32 // enum
	AutoSelectOnWebSites            bool
	BundledUpdates                  []*IUpdateIdentity // These are full IUpdate objects, but we truncate them
	BrowseOnly                      bool               // From IUpdate3
	CanRequireSource                bool
	Categories                      []*ICategory
	CveIDs                          []string // From IUpdate2
	Deadline                        *time.Time
	DeltaCompressedContentAvailable bool
	DeltaCompressedContentPreferred bool
	DeploymentAction                int32 // enum
	Description                     string
	DownloadContents                []*IUpdateDownloadContent
	DownloadPriority                int32 // enum
	EulaAccepted                    bool
	EulaText                        string
	HandlerID                       string
	Identity                        *IUpdateIdentity
	Image                           *IImageInformation
	InstallationBehavior            *IInstallationBehavior
	IsBeta                          bool
	IsDownloaded                    bool
	IsHidden                        bool
	IsInstalled                     bool
	IsMandatory                     bool
	IsPresent                       bool // From IUpdate2
	IsUninstallable                 bool
	KBArticleIDs                    []string
	Languages                       []string
	LastDeploymentChangeTime        *time.Time
	MaxDownloadSize                 int64
	MinDownloadSize                 int64
	MoreInfoUrls                    []string
	MsrcSeverity                    string
	PerUser                         bool // From IUpdate4
	RebootRequired                  bool // From IUpdate2
	RecommendedCpuSpeed             int32
	RecommendedHardDiskSpace        int32
	RecommendedMemory               int32
	ReleaseNotes                    string
	SecurityBulletinIDs             []string
	SupersededUpdateIDs             []string
	SupportUrl                      string
	Title                           string
	UninstallationBehavior          *IInstallationBehavior
	UninstallationNotes             string
	UninstallationSteps             []string
	// contains filtered or unexported fields

IUpdate contains the properties and methods that are available to an update.

func (*IUpdate) AcceptEula

func (iUpdate *IUpdate) AcceptEula() error

AcceptEula accepts the Microsoft Software License Terms that are associated with Windows Update. Administrators and power users can call this method.

type IUpdateDownloadContent

type IUpdateDownloadContent struct {
	DownloadUrl string
	// contains filtered or unexported fields

IUpdateDownloadContent represents the download content of an update.

type IUpdateException

type IUpdateException struct {
	Context int32 // enum
	HResult int64
	Message string
	// contains filtered or unexported fields

IUpdateException represents info about the aspects of search results returned in the ISearchResult object that were incomplete. For more info, see Remarks.

type IUpdateHistoryEntry

type IUpdateHistoryEntry struct {
	ClientApplicationID string
	Date                *time.Time
	Description         string
	HResult             int32
	Operation           int32 // enum
	ResultCode          int32 // enum
	ServerSelection     int32 // enum
	ServiceID           string
	SupportUrl          string
	Title               string
	UninstallationNotes string
	UninstallationSteps []string
	UnmappedResultCode  int32
	UpdateIdentity      *IUpdateIdentity
	// contains filtered or unexported fields

IUpdateHistoryEntry represents the recorded history of an update.

type IUpdateIdentity

type IUpdateIdentity struct {
	RevisionNumber int32
	UpdateID       string
	// contains filtered or unexported fields

IUpdateIdentity represents the unique identifier of an update.

type IUpdateSearcher

type IUpdateSearcher struct {
	CanAutomaticallyUpgradeService      bool
	ClientApplicationID                 string
	IncludePotentiallySupersededUpdates bool
	Online                              bool
	ServerSelection                     int32
	ServiceID                           string
	// contains filtered or unexported fields

IUpdateSearcher searches for updates on a server.

func (*IUpdateSearcher) GetTotalHistoryCount

func (iUpdateSearcher *IUpdateSearcher) GetTotalHistoryCount() (int32, error)

GetTotalHistoryCount returns the number of update events on the computer.

func (*IUpdateSearcher) QueryHistory

func (iUpdateSearcher *IUpdateSearcher) QueryHistory(startIndex int32, count int32) ([]*IUpdateHistoryEntry, error)

QueryHistory synchronously queries the computer for the history of the update events.

func (*IUpdateSearcher) QueryHistoryAll

func (iUpdateSearcher *IUpdateSearcher) QueryHistoryAll() ([]*IUpdateHistoryEntry, error)

QueryHistoryAll synchronously queries the computer for the history of all update events.

func (*IUpdateSearcher) Search

func (iUpdateSearcher *IUpdateSearcher) Search(criteria string) (*ISearchResult, error)

Search performs a synchronous search for updates. The search uses the search options that are currently configured.

type IUpdateSession

type IUpdateSession struct {
	ClientApplicationID string
	ReadOnly            bool
	// contains filtered or unexported fields

IUpdateSession represents a session in which the caller can perform operations that involve updates. For example, this interface represents sessions in which the caller performs a search, download, installation, or uninstallation operation.

func NewUpdateSession

func NewUpdateSession() (*IUpdateSession, error)

NewUpdateSession creates a new Microsoft.Update.Session object

func (*IUpdateSession) CreateUpdateSearcher

func (iUpdateSession *IUpdateSession) CreateUpdateSearcher() (*IUpdateSearcher, error)

CreateUpdateSearcher returns an IUpdateSearcher interface for this session.

func (*IUpdateSession) GetLocal

func (iUpdateSession *IUpdateSession) GetLocal() (uint32, error)

func (*IUpdateSession) SetLocal

func (iUpdateSession *IUpdateSession) SetLocal(locale uint32) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL