MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / uninstall

Function uninstall

scripts/install_api.py:175–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

173
174
175def 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
200if __name__ == '__main__':

Callers 1

install_api.pyFile · 0.85

Calls 3

binaryninja_installedFunction · 0.85
print_errorFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected