Skip to content

Commit

Permalink
Merge pull request #33 from TheZ3ro/main
Browse files Browse the repository at this point in the history
Check GHIDRA_INSTALL_DIR on Launcher initialization
  • Loading branch information
dc3-tsd authored Jan 17, 2024
2 parents f071e86 + 914716c commit 15ec91f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pyhidra/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ class PyhidraLauncher:
"""

def __init__(self, verbose):
if GHIDRA_INSTALL_DIR is None:
self._report_fatal_error(
"GHIDRA_INSTALL_DIR is not set",
textwrap.dedent("""\
Please set the GHIDRA_INSTALL_DIR environment variable
to the directory where Ghidra is installed
""").rstrip()
)

self._plugins = []
self.verbose = verbose
self.java_home = None
Expand Down Expand Up @@ -180,15 +189,6 @@ def start(self, **jpype_kwargs):
if jpype.isJVMStarted():
return

if GHIDRA_INSTALL_DIR is None:
self._report_fatal_error(
"GHIDRA_INSTALL_DIR is not set",
textwrap.dedent("""\
Please set the GHIDRA_INSTALL_DIR environment variable
to the directory where Ghidra is installed
""").rstrip()
)

self.check_ghidra_version()

# Before starting up, give launcher to installed entry points so they can do their thing.
Expand Down

0 comments on commit 15ec91f

Please sign in to comment.