Skip to content

Read Windows registry for installed packages #2565

@JonoYang

Description

@JonoYang

In the case of scanning Windows containers, it would be nice to have scancode be able to detect installed programs from the Windows registry.

Since Windows does not use a package manager to install programs, so we cannot examine it for installed packages, like we would for a Linux distro. What we can do is get the list of installed programs on a Windows system by looking in the registry at the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\. All installed programs that have uninstallers are listed here. For each program listed, there is a set of keys that can be used:

  • InstallLocation
    • Allows us to know which files to associate with the program
  • DisplayName
    • Used for package name
  • DisplayVersion
    • Used for package version
  • URLAboutInfo
    • Can be used for homepage_url

Installed programs can also be found in these locations

  • HKEY_LOCAL_MACHINE\SOFTWARE\
  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE
  • HKEY_CURRENT_USER\SOFTWARE\

However, the keys used to store the install location of these programs vary:

  • Dir
  • InstallDir
  • InstallPath
  • Path
  • InstallationPath
  • InstallLocation
  • install dir
  • install folder

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions