Pregunta

While working on an auditing project I came across different problems regarding software and licenses. My project runs on Linux with Perl and I successfully retried remote machine software via both SNMP and WMI. The big issue is that the two protocols return quite different results. For instance one may find a program and the other may not, and vice versa.

I know that SNMP retrieves software wich have a related uninstall key on (correct me if I am wrong):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

But what about Win32_Product? This is what the documentation says about:

The Win32_Product WMI class represents products as they are installed by Windows Installer. A product generally correlates to one installation package.

What does that mean? And, last but not least, is there a way to improve how installed software are retrieved? I mean if I lookt at my installed software from the control panel and confront results with SNMP and WMI there are a lot of wierd things.

EDIT: Just a quick update, I developed a couple of programs in .NET C# that I installed on many computers. Too bad neither WMI and SNMP find them out. I installed these programs with the usual Visual Studio generated setup. Any hints?

¿Fue útil?

Solución

People basically use WMI to query various system parameters. WMI exposes a lot of interfaces which one can leverage. It is mostly used with VBScript but one can also use C++/COM or C# to interact with it. This Wikipedia article can give you a detailed explanation about WMI and then you may understand what Win32_Product Class does. This is another great article and a must-read for someone beginning to work with WMI.

Also go through these articles without fail:

Retrieving a CLASS

Retrieving an Instance

Retrieving part of an Instance

Accessing a Qualifier

These articles will give you a good understanding of WMI concepts.

As far as Windows installer is concerned:

Windows installer is based on Server-Client architecture. The Windows Installer is actually a Windows Service. The various features that Windows installer supports has made it the most standard method of application life-cycle management. The Basic MSI(there is nothing Basic about it) package with the .msi extension is used to package and distribute apps.

The Basic MSI package is basically a DATABASE. The application binaries and other stuff may be packaged as CAB files and included in the MSI package or may exist outside of it.

This is known as TRANSACTIONAL install method. The Application Packaging developer just has to fill in the various tables in the database and the Windows Installer engine takes care of everything else. This may seem or sound easy but is very difficult and needs a lot of knowledge.

When the application is installed on to any sytem, Windows Installer writes all the Registry keys needed for proper management of all resources installed on to the system. As the life-cycle of an application is managed by Windows Installer, it can easily support:

1) Repair

2) Resilience

Once you go through all this, you may have a better idea of all the parties involved in your case. Then you will have clearer questions(or may not!), and we can help you better(or you may not need it at all!).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top