ceshihao / windowsupdate

A Golang binding for Windows Update Agent API
https://pkg.go.dev/github.com/ceshihao/windowsupdate
Apache License 2.0
11 stars 7 forks source link

Install windows update example script is not working #6

Open hexclann opened 1 year ago

hexclann commented 1 year ago

Hello, I tried to integrate the example program into my code. It lists out the JSON data, but none of the updates are installed on my machine. If I go to the Windows Updates settings, I can see the updates with "Install" button.

Here is the code output: https://pastebin.com/9pGUEKA8

Is there any documentation for the JSON fields? How to extract only the available updates to my machine? I will try to make a list of available updates like this in my go program: powershell_pcL9iu7Cd3

ceshihao commented 1 year ago
Step 2: Download Updates
{"HResult":2359299,"ResultCode":3}

3 means orcSucceededWithErrors. https://learn.microsoft.com/en-us/windows/win32/api/wuapi/ne-wuapi-operationresultcode#constants

The operation is complete, but one or more errors occurred during the operation. The results might be incomplete.

Mapbe you need more logs to debug the error.