我试图用 IUpdateSearcher 接口的搜索方法的 WUA API 检索 Windows 更新。
我传递的搜索条件为“IsInstalled=1 或 IsPresent=1”。请在下面找到示例代码。
IUpdateSearcher* searcher;
ISearchResult* results;
/*
.
.
Code to initialize COM and get UpdateSearcher*/
.
.
*/
hRes = searcher->Search("IsInstalled=1 or IsPresent=1", &results);
我已经浏览了 MSDN 中 IsInstalled 和 IsPresent 的定义(复制以供参考)。两者都在谈论类似的事情。
IsPresent
When set to 1, finds updates that are present on a computer.
"IsPresent=1" finds updates that are present on a destination computer. If the update
is valid for one or more products, the update is considered present if it is installed
for one or more of the products."IsPresent=0" finds updates that are not installed
for any product on a destination computer.
IsInstalled
Finds updates that are installed on the destination computer.
"IsInstalled=1" finds updates that are installed on the destination computer.
"IsInstalled=0" finds updates that are not installed on the destination computer.
有人可以澄清他们到底有什么不同吗?