使用程序检查已安装的软件 [英] To check installed software using a program

查看:28
本文介绍了使用程序检查已安装的软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要创建一个程序..实际上我们被要求创建一个软件许可合规工具..我们如何检查机器内安装的软件..是通过注册表吗...在搜索时我看到一个帖子说我们需要查看 HKLM 的卸载"子项.

We need to create a program ..actually we were asked to create a software licensing compliance tool....How do we check the installed software inside the machine.. Is it through the registry...while searching i saw a post which said we need to look into the "uninstall" subkey of HKLM .

我们还获得有关软件是否是免费软件、共享软件、从注册表获得许可的信息????

Also do we also get information about whether the s/w is freeware ,shareware, licensed from the registry????

我们计划使用 Python 和 Mysql 来做到这一点

We plan to do this using Python and Mysql

推荐答案

正如您已经提到的,可以在注册表项下找到(正确)安装的程序列表

As you already mentioned the list of (properly) installed programs can be found in the registry under the key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

请参阅此处例如或使用谷歌获取更多信息.用regedit看看这个key,结构id很明显.

See here for example or use google for further information. Have a look at this key using regedit, the structure id quite obvious.

有关使用 python 访问注册表,请参阅 python 中的 _winreg – Windows 注册表访问标准库文档.

For accessing the registry using python, see _winreg – Windows registry access in the python standard library documentation.

请注意,注册表中可能总会有一些软件没有显示:有些软件仍然可以通过将其放在目录中来安装,您不会抓住这些人...

Note that there may always be software which doesnt show up in the registry: Some software can still be installed by just putting it in a directory, you'll not catch these guys...

对于第二部分,无法通过查看注册表来判断许可类型或许可状态(即正确许可).没有存储此信息的标准方法.您能做的最好的事情是编译一个包含尽可能多的程序的列表(您必须手动执行此操作,即使对于 Office、Adobe 等标准程序也很耗时)并存储所有必要的信息(即注册表中的 GUID 键、许可证类型等).

For the second part, there is no way of telling the license type or licensing status (i.e. properly licensed) from looking at the registry. There is no standard way to store this information. The best you can do is to compile a list of as many programs as you can (you'll have to do this by hand, that will be time-consuming even for standard programs like Office, Adobe etc.) and store all necessary information (i.e. GUID key in registry, license type etc.) in a database.

然后,您的工具可以将当前安装的程序列表与您的列表进行比较,可能会检查许可状态.作为第一步,这将更加困难,因为每个软件都有自己的(主要是秘密的!)存储方式 - 毕竟如果可以访问这些信息,它也可以被伪造.

Your tool could then compare the list of currently installed programs against your list, possibly checking the licensing status. This will be even harder as the first step since every software has it's own (mostly secret!) way of storing this - after all if this information is accessible it could also be forged.

然后你的工具可以通知系统管理员关于它的发现和任何不在列表中的程序,他必须手动检查它们的许可.您可以为管理这些信息提供一些组织方面的帮助,甚至可能更新数据库以备将来使用.

Then your tool could inform the system adminstrator about its findings and any programs that are not on the list, he would have to check the licensing manually for them. You could provide some organisational help for managing this information and perhaps even update the database for future use.

HTH

马丁

这篇关于使用程序检查已安装的软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆