diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2019-06-13 14:29:59 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2019-06-13 14:29:59 -0400 |
| commit | e4fd9c426f60544960d66080093292e146abed5e (patch) | |
| tree | 2ae55f705231ccfcaa77b611353c240faaf34aee /scripts/install_api.py | |
| parent | 977a0caa78e9a8ddb958baf535df881bbaaf05b4 (diff) | |
simplify path location and fix for windows user-installs for install_api.py
Diffstat (limited to 'scripts/install_api.py')
| -rw-r--r-- | scripts/install_api.py | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/scripts/install_api.py b/scripts/install_api.py index 30084e1b..6e49f438 100644 --- a/scripts/install_api.py +++ b/scripts/install_api.py @@ -23,26 +23,19 @@ if '-s' in sys.argv[1:]: try: import binaryninja import binaryninjaui #To better detect if migrating from a version without UI plugin support - print("Binary Ninja API already Installed") + print("Binary Ninja API already in the path") sys.exit(1) except ImportError: pass -if sys.platform.startswith("linux"): - userpath = os.path.expanduser("~/.binaryninja") - lastrun = os.path.join(userpath, "lastrun") - if os.path.isfile(lastrun): - lastrunpath = open(lastrun).read().strip() - api_path = os.path.join(lastrunpath, "python") - print("Found install folder of {}".format(api_path)) - else: - print("Running on linux, but ~/.binaryninja/lastrun does not exist") - sys.exit(0) -elif sys.platform == "darwin": - api_path = "/Applications/Binary Ninja.app/Contents/Resources/python" +dir_name = os.path.dirname(os.path.abspath(__file__)) +api_path = os.path.abspath(os.path.join(dir_name, "..", "python")) + +if (os.path.isdir(api_path)): + print("Found install folder of {}".format(api_path)) else: - # Windows - api_path = "r'C:\Program Files\Vector35\BinaryNinja\python'" + print("Failed to find installed python expected at {}".format(api_path)) + sys.exit(1) def validate_path(path): |
