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#?