MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_msi_info

Function get_msi_info

src/packagedcode/msi.py:82–102  ·  view source on GitHub ↗

Run the command `msiinfo suminfo` on the file at `location` and return the results in a dictionary This function requires `msiinfo` to be installed on the system, either by installing the `packagedcode-msiinfo` plugin or by installing `msitools` through a package manager.

(location)

Source from the content-addressed store, hash-verified

80
81
82def get_msi_info(location):
83 """
84 Run the command `msiinfo suminfo` on the file at `location` and return the
85 results in a dictionary
86
87 This function requires `msiinfo` to be installed on the system, either by
88 installing the `packagedcode-msiinfo` plugin or by installing `msitools`
89 through a package manager.
90 """
91 # FIXME: what about the return code? we ignore it?
92 rc, stdout, stderr = execute(
93 cmd_loc=get_msiinfo_bin_location(),
94 args=[
95 'suminfo',
96 location,
97 ],
98 )
99 if stderr or rc:
100 error_message = f'Error encountered when reading MSI information from {location}: {stderr}'
101 raise MsiinfoException(error_message)
102 return parse_msiinfo_suminfo_output(stdout)
103
104
105def get_version_from_subject_line(subject_line):

Callers 1

msi_parseFunction · 0.85

Calls 4

executeFunction · 0.90
get_msiinfo_bin_locationFunction · 0.85
MsiinfoExceptionClass · 0.85

Tested by

no test coverage detected