windowsupdate

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: Apache-2.0 Imports: 3 Imported by: 2

README

WindowsUpdate

A Golang binding for Windows Update Agent API using go-ole/go-ole.

You can find some examples.

Documentation

Index

Constants

View Source
const (
	OperationResultCodeOrcNotStarted int32 = iota
	OperationResultCodeOrcInProgress
	OperationResultCodeOrcSucceeded
	OperationResultCodeOrcSucceededWithErrors
	OperationResultCodeOrcFailed
	OperationResultCodeOrcAborted
)

OperationResultCode defines the possible results of a download, install, uninstall, or verification operation on an update. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-operationresultcode

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/en-us/windows/win32/api/wuapi/nn-wuapi-icategory

type IDownloadResult

type IDownloadResult struct {
	HResult    int32
	ResultCode int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-operationresultcode
	// contains filtered or unexported fields
}

IDownloadResult represents the result of a download operation. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-idownloadresult

func (*IDownloadResult) GetUpdateResult

func (iDownloadResult *IDownloadResult) GetUpdateResult(updateIndex int32) (*IUpdateDownloadResult, error)

GetUpdateResult returns an IUpdateDownloadResult interface that contains the download information for a specified update. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-idownloadresult-getupdateresult

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/en-us/windows/win32/api/wuapi/nn-wuapi-iimageinformation

type IInstallationBehavior

type IInstallationBehavior struct {
	CanRequestUserInput         bool
	Impact                      int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-installationimpact
	RebootBehavior              int32 // enum https://docs.microsoft.com/en-us/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/en-us/windows/win32/api/wuapi/nn-wuapi-iinstallationbehavior

type IInstallationResult

type IInstallationResult struct {
	HResult        int32
	RebootRequired bool
	ResultCode     int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-operationresultcode
	// contains filtered or unexported fields
}

IInstallationResult represents the result of an installation or uninstallation. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iinstallationresult

type ISearchResult

type ISearchResult struct {
	ResultCode     int32 // enum https://docs.microsoft.com/en-us/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 {
	AutoSelectOnWebSites            bool
	BundledUpdates                  []*IUpdateIdentity
	CanRequireSource                bool
	Categories                      []*ICategory
	Deadline                        *time.Time
	DeltaCompressedContentAvailable bool
	DeltaCompressedContentPreferred bool
	DeploymentAction                int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-deploymentaction
	Description                     string
	DownloadContents                []*IUpdateDownloadContent
	DownloadPriority                int32 // enum https://docs.microsoft.com/en-us/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
	IsUninstallable                 bool
	KBArticleIDs                    []string
	Languages                       []string
	LastDeploymentChangeTime        *time.Time
	MaxDownloadSize                 int64
	MinDownloadSize                 int64
	MoreInfoUrls                    []string
	MsrcSeverity                    string
	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/en-us/windows/win32/api/wuapi/nn-wuapi-iupdatedownloadcontent

type IUpdateDownloadResult

type IUpdateDownloadResult struct {
	HResult    int32
	ResultCode int32
	// contains filtered or unexported fields
}

IUpdateDownloadResult contains the properties that indicate the status of a download operation for an update. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdatedownloadresult

type IUpdateDownloader

type IUpdateDownloader struct {
	ClientApplicationID string
	IsForced            bool
	Priority            int32 // enum https://docs.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-downloadpriority
	Updates             []*IUpdate
	// contains filtered or unexported fields
}

IUpdateDownloader downloads updates from the server. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdatedownloaders

func (*IUpdateDownloader) Download

func (iUpdateDownloader *IUpdateDownloader) Download(updates []*IUpdate) (*IDownloadResult, error)

Download starts a synchronous download of the content files that are associated with the updates. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdatedownloader-download

type IUpdateException

type IUpdateException struct {
	Context int32 // enum https://docs.microsoft.com/en-us/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/en-us/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 IUpdateInstaller

type IUpdateInstaller struct {
	AllowSourcePrompts  bool
	ClientApplicationID string
	IsBusy              bool
	IsForced            bool
	// ParentHwnd                       HWND
	// ParentWindow                     IUnknown
	RebootRequiredBeforeInstallation bool
	Updates                          []*IUpdate
	// contains filtered or unexported fields
}

IUpdateInstaller installs or uninstalls updates from or onto a computer. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdateinstaller

func (*IUpdateInstaller) Install

func (iUpdateInstaller *IUpdateInstaller) Install(updates []*IUpdate) (*IInstallationResult, error)

Install starts a synchronous installation of the updates. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdateinstaller-install

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/en-us/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
	WebProxy            *IWebProxy
	// 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 IUpdateSession interface.

func (*IUpdateSession) CreateUpdateDownloader

func (iUpdateSession *IUpdateSession) CreateUpdateDownloader() (*IUpdateDownloader, error)

CreateUpdateDownloader returns an IUpdateDownloader interface for this session. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdatesession-createupdatedownloader

func (*IUpdateSession) CreateUpdateInstaller

func (iUpdateSession *IUpdateSession) CreateUpdateInstaller() (*IUpdateInstaller, error)

CreateUpdateInstaller returns an IUpdateInstaller interface for this session. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdatesession-createupdateinstaller

func (*IUpdateSession) CreateUpdateSearcher

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

CreateUpdateSearcher returns an IUpdateSearcher interface for this session. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iupdatesession-createupdatesearcher

type IWebProxy

type IWebProxy struct {
	Address            string
	AutoDetect         bool
	BypassList         []string
	BypassProxyOnLocal bool
	ReadOnly           bool
	UserName           string
	// contains filtered or unexported fields
}

IWebProxy contains the HTTP proxy settings. https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iwebproxy

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL