0

I want to develop an extension with C# language to get all installed software on Windows OS along with their license information.

To do this, at the first, I referred to the Windows registry but in this solution, we know some licenses are not stored in the registry and also some licenses key may be encrypted or obfuscated. Therefore, as a second solution, I use the "Win32_Product" WMI class but this solution may take some time to execute, especially on machines with a large number of installed software products. Also, not all software products may have license information available via WMI, so some license information may be blank. And, as the last solution, I wanted to use Osquery but it needs "Slmgr" as a third-party tool that should be installed on all machines.

How can I get all installed software on Windows OS along with their corresponding license information with C#?

  • Did you look at winget: https://github.com/microsoft/winget-cli – rene Apr 25 '23 at 06:22
  • I would recommend looking at https://github.com/Klocman/Bulk-Crap-Uninstaller. I am not related to the project. – Jazz. Apr 25 '23 at 07:24

1 Answers1

1

You could get a list of all applications. But there is no possible way to reliably get license keys or other license information. Applications can manage licenses however they want.

We store license keys as part of the application configuration, either in a config file or in a database. Without knowing what you are looking for, you could not separate it from any of the other configuration. The license information might not even be on the computer, it is perfectly possible that the application authenticates online at startup.

JonasH
  • 28,608
  • 2
  • 10
  • 23