1

I'm trying to install a feature update using WUAPI. I believe I need IUpdateInstaller4::Commit method but I cannot make it work. Without the commit method the feature update stays in the processing state after the installation. I already tried few things:

  • updateSession.CreateUpdateInstaller() returns IUpdateInstaller not IUpdateInstaller4. Anyway I tried:
var updateInstaller4= (IUpdateInstaller4) updateSession.CreateUpdateInstaller();

// installation logic

updateInstaller4.Commit(1);

It got stuck for some time at the commit method and finished successfully but the update was not installed

  • I also tried:
var updateInstaller4 = (IUpdateInstaller4) new WUApiLib.UpdateInstallerClass();
updateInstaller4.Commit(1);

But I get : 'Exception from HRESULT: 0x80240004'

Is it even a good approch to install the feature updates? Thank you for any help.

  • FWIW, 0x80240004 is WU_E_NOT_INITIALIZED so it looks like your API call workflow is broken – Simon Mourier May 21 '20 at 16:18
  • I am working on a project to list and install all pending windows updates. I am successfully able to do this, but when I use the WUAPI and do a search, Windows Features are not even listed. *** ISearchResult uResult = uSearcher.Search("IsInstalled=0 or IsInstalled=1")... *** How did you even get the Feature to list, let alone install – Chris Dunlop Mar 27 '21 at 16:33
  • @ChrisDunlop I can't remember what I passed to uSearcher.Search. But there was a strange parameter in addition to "IsInstalled=0 or IsInstalled=1". I know that I found it on github but I can't find it now. BTW we never succeeded with this project. – Wojciech Waniek Apr 08 '21 at 18:53

0 Answers0