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)
| 80 | |
| 81 | |
| 82 | def 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 | |
| 105 | def get_version_from_subject_line(subject_line): |
no test coverage detected