()
| 173 | |
| 174 | |
| 175 | def uninstall() -> bool: |
| 176 | |
| 177 | if not binaryninja_installed(): |
| 178 | print_error("Uninstall specified, but binaryninja not in the current path.") |
| 179 | return False |
| 180 | |
| 181 | user_path = os.path.join(getusersitepackages(), "binaryninja.pth") |
| 182 | site_path = os.path.join(getsitepackages()[0], "binaryninja.pth") |
| 183 | |
| 184 | for path_to_unlink in [user_path, site_path]: |
| 185 | |
| 186 | if not os.path.exists(path_to_unlink): |
| 187 | print_error(f"{path_to_unlink} not found.") |
| 188 | continue |
| 189 | |
| 190 | print(f"Removing {path_to_unlink}...") |
| 191 | try: |
| 192 | os.unlink(path_to_unlink) |
| 193 | except OSError as e: |
| 194 | print_error(f"Unable to unlink, please re-run with appropriate permissions: {str(e)}") |
| 195 | return False |
| 196 | |
| 197 | return True |
| 198 | |
| 199 | |
| 200 | if __name__ == '__main__': |
no test coverage detected