简体   繁体   中英

How to programmatically detect if Windows 8.1 Update is installed

I'd like to detect from a C# application whether the latest Windows 8.1 Update (KB 2919355) is installed

I haven't been able to find anything on any of microsoft's sites or via google that indicates how one might do this.

Thanks!

That update is actually a "rollup" or a collection of other separate smaller updates. If you go to the Knowledge base page for the update and scroll down to the "File information" you can see the update is actually the combination of the following other updates.

  • KB2919442
  • KB2919355
  • KB2932046
  • KB2937592
  • KB2938439
  • KB2934018

You will then need to either check that all of the above listed updates are applied or the single master update is applied. I am not sure how to do that in C# alone but via the commandline you can just do it by the console command

wmic qfe get hotfixid | find "KB2919355"

I installed Windows 8.1 Update from an MSDN download before it went live on Windows Update. It was distributed as a series of MSU files with a ReadMe. The list of updates in the ReadMe may be useful, if you choose to detect their presence.

Windows 8.1, Windows Server 2012 R2, Windows RT 8.1 Update

Recommended Install Order
1.  KB2919442
2.  KB2919355
3.  KB2932046
4.  KB2937592
5.  KB2938439
6.  KB2949621

This may be the culprit:

Operating system version changes in Windows 8.1 and Windows Server 2012 R2

Manifestation

In Windows 8.1, the GetVersion(Ex) APIs have been deprecated. That means that while you can still call the APIs, if your app does not specifically target Windows 8.1, you will get Windows 8 versioning (6.2.0.0).

Solution

In order to target Windows 8.1, you need to either include the app manifest or include _NT_TARGET_VERSION=$ (_NT_TARGET_VERSION_LATEST) in the source file.

Mode details of the required manifest contents are given in the article.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM