How to find out the version of installed programs? Ie on the PC software installed I get a list of installed programs and their version. For windows. How can this be implemented?

  • What is your version?) - Vladimir Klykov
  • Programs have versions, for example V1.0, 3.2.7, etc. - Alex Firsov
  • Not everyone. And the answer to your question is nothing in the general case. In particular cases - deal with each separately .... - Vladimir Klykov

2 answers 2

To display a list of installed programs in windows, you can use the command:

wmic product get name,version PS C:\Windows\system32> wmic product get name,version Name Version Microsoft DCF MUI (Russian) 2016 16.0.4266.1001 Microsoft Office Professional Plus 2016 16.0.4266.1001 Microsoft Visio Professional 2016 16.0.4266.1001 

In python, you can get and parse this list:

 from subprocess import check_output check_output("wmic product get name,version") 

The script must run as administrator.

  • This is a very incomplete list, only what was installed by Windows Installer (that is, what is in the HKCR \ Installer \ Products branch). For example, such a common installer as Inno Setup does not write anything there. Not to mention a considerable number of programs that are installed simply by unpacking from zip. - freim
  • @freim and this is the only "legal")) way to install programs and the ability to get it. And so, yes, in any OS you can deploy the archive without using any package manager and run the program manually. And you can also run programs with an interpreter. But the question was “How to find out the versions of installed programs” - Dmitry Kozlov
  • When executing the script, I get product get name - Alias ​​not found. subprocess.CalledProcessError: Command '[' wmic ',' product get name, version ']' re turned non-zero exit status 44135 - Alex Firsov
  • Try not sharing a single line wmic product get name,version - Dmitry Kozlov
  • @Dmitry Kozlov, about the fact that Windows Installer is the only legal way to install software - let's take it as a joke. Even MS did not think of such a statement. Estimate, by the way, how many programs are installed by alternative installers. MSI is far outnumbered. - freim

In Windows, there is no way to identify the "installed program", whatever that might be understood. Unless you want to find all the .exe on the disk.

As for the version, the program resources may contain a VERSIONINFO record. But not all programs have this record, and if there is, then there is no guarantee that there really is a real version number. The programmer can maintain the current version in the About dialog, and the resources of the tenth year are hanging 1.0.0.0