go-win64api icon indicating copy to clipboard operation
go-win64api copied to clipboard

Feature Request: Provide Additional Win Update Functionality

Open ryangurn opened this issue 3 years ago • 3 comments

I noticed while reading the code within winupdate.go that there are two private functions. One for listing updates and another for update history. It would be quite useful to be able to access this type of information through some public functions.

I don't think that it would be difficult to add a public version of listUpdates() that provided the output using the struct already existing in the shared folder. updateHistory() based on my review could potentially just be made public with no changes.

I would ask that there is some consideration for making the information that those two functions provide accessible outside UpdatesPending() if possible.

Its also possible that I am misunderstanding the code in some way, so if it is already possible to access this data through UpdatesPending() please advise me so I can attempt to access this information for a project of mine.

ryangurn avatar Aug 29 '21 09:08 ryangurn

It doesn't appear that UpdatesPending() shows any history or list of updates but again maybe im using it incorrectly.

ryangurn avatar Aug 29 '21 09:08 ryangurn

Sorry guys I hadn’t seen the notification for this…

I really struggled to implement anything useful in the Windows Update space, especially that is compatible with Windows 10/11

There are some PowerShell utils that I tried to decompile & replicate but on further testing, none of those really worked like I expected either..

It’s been a while but in the end we came to the conclusion that the GUI is the source of truth & none of the CLI tools or libs have a good way to access the data.

I’m happy to take advice on this if anyone has any?

iamacarpet avatar Mar 11 '22 17:03 iamacarpet

Im not entirely sure the best method to go with however WMI might provide some insight.

Looking through https://docs.microsoft.com/en-us/previous-versions//aa390887(v=vs.85)?redirectedfrom=MSDN

In this there is Win32_Patch, Win32_PatchFile and Win32_PatchPackage. I don't know but these might be helpful to figure out if there are any updates available. Not for all applications for at least for the operating system itself.

ryangurn avatar Mar 15 '22 23:03 ryangurn