1

I want to get hotfix installed on my computer in C#, when I use wmi through Win32_QuickFixEngineering, I got 33 hotfix installed on my computer. But when I use WUApiLib through IUpdateSearcher, I got 19 hotfix installed on my computer. And I found that there are 2 hotfix which are in the 19 but not in the 33.

Method 1: wmi

ManagementObjectSearcher hotfixmos = new ManagementObjectSearcher("Select * from Win32_QuickFixEngineering");

Method 2: WUApi

UpdateSession UpdateSession = new UpdateSession();
IUpdateSearcher UpdateSearchResult = UpdateSession.CreateUpdateSearcher();
UpdateSearchResult.Online = false;
ISearchResult SearchResults = UpdateSearchResult.Search("IsInstalled=1");

Why they are different?

Mike Z
  • 4,121
  • 2
  • 31
  • 53
  • An update just isn't the same thing as a hot-fix. – Hans Passant Dec 14 '13 at 16:15
  • thank you @HansPassant , if I want to get hotfix installed on my computer, which method is better? – jonnystill7 Dec 16 '13 at 10:57
  • You download it and run the installer. Do note that what you are doing makes very little sense. It only tells you which hot-fixes you already have and *don't* need to be installed. There's no mechanism to discover hot-fixes beyond reading about it in a KB article. In general, *never* just install hot-fixes willy-nilly, they are only meant as a workaround for a specific problem with a specific program and were not thoroughly tested to ensure that they don't in turn cause a problem with some other program. – Hans Passant Dec 16 '13 at 12:14

0 Answers0