TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Don't use Win32_product to find installed software (2020)

39 pointsby sts153over 2 years ago

5 comments

PreInternet01over 2 years ago
Ah, yes, an oldie but a goodie: running a <i>read-only query</i> on a widely-advertised system management class causes a flurry of (potentially disruptive if the underlying app for a &#x27;reconfigured&#x27; package is running) activity and an impressive amount of event log spam.<p>The workarounds listed in the linked article are solid, but this definitely remains a runner-up for &quot;dumbest thing ever&quot;...
bobinceover 2 years ago
Yeah Win32_Product is a disaster, even by WMI standards.<p>The proper way to enumerate the Windows Installer database <i>should</i> be MsiEnumProductsEx. Except. If someone has monkeyed with a product key name in the registry such that it&#x27;s longer than normal(...), MsiEnumProductsEx spits ERROR_MORE_DATA for that product and all subsequent dwIndex values (so if you&#x27;re waiting for ERROR_NO_MORE_ITEMS you&#x27;ll have a fun hang).<p>(...which sounds like it shouldn&#x27;t happen, but it turns out there are a bunch of users following forum post advice to hide a product by renaming it with a _Disabled suffix. oh dear)<p>So in reality you&#x27;ll probably have to access the undocumented registry backend for the Windows Installer database, in HKLM\Software\Classes\Installer\Products, converting the weird backwards-struct form of the UUID in each key name to the real ProductCode.<p>Of course not all software uses MSI packages or can be found in the Windows Installer database. You can indeed go to the Add&#x2F;Remove Programs database in HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstaller, except that the data there is super low quality. You&#x27;ll have bogus products missing name and&#x2F;or version, nonsense entries for things no longer present, inconsistently named products between versions, and products with different names on different locales. Which makes it quite difficult to do anything with this data.<p>There isn&#x27;t really a single source of truth for &quot;what products are installed&quot; under Windows and all options for reporting what&#x27;s installed are pretty bad.
alkonautover 2 years ago
The idea of “installing” software to a user data directory, but <i>not</i> registering anything to add&#x2F;remove programs seems strange.<p>If I just unzip an app to some directory then I deliberately want to avoid registering it so few would consider that “installing” or expect it to be listed in any program lists.<p>Newer install methods that install to unprivileged locations (typically using Squirrel, like Teams for example) of course register their apps to the Add&#x2F;Remove programs list.<p>What’s confusing is they don’t modify this record when the program is self-updated, so the add&#x2F;remove programs list will forever show the 1.0 version.
whodevover 2 years ago
I&#x27;ve had to have this argument so many times when I was working as a desktop tech.
sts153over 2 years ago
Quite old, but a good solution for a Windows 10+ admin