I found a Microsoft API called WUApi (Windows Update Agent API)
It is a COM library (WUApiLib).
https://msdn.microso...y/aa387101.aspx
I wrote a proof of concept C# console app just to see if it works. I have mixed results.
The code:
using System;
using System.Collections.Generic;
using System.Text;
using WUApiLib;
namespace WUApiExample
{
class Program
{
static void Main(string[] args)
{
UpdateSession uSession = new UpdateSession();
IUpdateSearcher uSearcher = uSession.CreateUpdateSearcher();
uSearcher.Online = false;
try
{
ISearchResult sResult = uSearcher.Search("IsInstalled=1 and Type='Software' and IsHidden=0");
Console.WriteLine( "Found " + sResult.Updates.Count + " updates" + Environment.NewLine);
foreach (IUpdate update in sResult.Updates)
{
Console.WriteLine(update.Title + Environment.NewLine);
}
}
catch (Exception ex)
{
Console.WriteLine("Something went wrong: " + ex.Message);
}
Console.ReadLine();
}
}
}
The above code always returns 2 results.
The Search Parameters "IsInstalled=1 and Type='Software' and IsHidden=0" can be changed to modify the results but the most I have ever had were 2 hits.
I have even gone so far as to change the search parameters to "IsInstalled=1" or simply "Type='Software'"
Does anyone have experience with this API? What am I doing wrong?