windowsupdate

package
v0.11.22 Latest Latest
Warning

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

Documentation

Overview

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

This code derives from https://github.com/ceshihao/windowsupdate

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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. https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/nn-wuapi-icategory

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. https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/nn-wuapi-iimageinformation

type IInstallationBehavior

type IInstallationBehavior struct {
	CanRequestUserInput         bool
	Impact                      int32 // enum https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/ne-wuapi-installationimpact
	RebootBehavior              int32 // enum https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/ne-wuapi-installationrebootbehavior
	RequiresNetworkConnectivity bool
	// contains filtered or unexported fields
}

IInstallationBehavior represents the installation and uninstallation options of an update. https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/nn-wuapi-iinstallationbehavior

type ISearchResult

type ISearchResult struct {
	ResultCode     int32 // enum https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/ne-wuapi-operationresultcode
	RootCategories []*ICategory
	Updates        []*IUpdate
	Warnings       []*IUpdateException
	// contains filtered or unexported fields
}

ISearchResult represents the result of a search. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-isearchresult

type IUpdate

type IUpdate struct {
	AutoDownload                    int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdate5-get_autodownload
	AutoSelection                   int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdate5-get_autoselection
	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 https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/ne-wuapi-deploymentaction
	Description                     string
	DownloadContents                []*IUpdateDownloadContent
	DownloadPriority                int32 // enum https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/ne-wuapi-downloadpriority
	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. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdate

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. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdate-accepteula

type IUpdateDownloadContent

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

IUpdateDownloadContent represents the download content of an update. https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/nn-wuapi-iupdatedownloadcontent

type IUpdateException

type IUpdateException struct {
	Context int32 // enum https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/ne-wuapi-updateexceptioncontext
	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. https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/nn-wuapi-iupdateexception

type IUpdateHistoryEntry

type IUpdateHistoryEntry struct {
	ClientApplicationID string
	Date                *time.Time
	Description         string
	HResult             int32
	Operation           int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-updateoperation
	ResultCode          int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-operationresultcode
	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. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdatehistoryentry

type IUpdateIdentity

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

IUpdateIdentity represents the unique identifier of an update. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdateidentity

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. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdatesearcher

func (*IUpdateSearcher) GetTotalHistoryCount

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

GetTotalHistoryCount returns the number of update events on the computer. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdatesearcher-gettotalhistorycount

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. https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/nf-wuapi-iupdatesearcher-queryhistory

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. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdatesearcher-search

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. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdatesession

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. https://docs.microsoft.com/zh-cn/windows/win32/api/wuapi/nf-wuapi-iupdatesession-createupdatesearcher

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
y or Y : Canonical URL