GP-0: Fixing PyGhidra version check when things like "-BETA" are present

This commit is contained in:
Ryan Kurtz
2025-11-19 06:22:44 -05:00
parent 17b29883a7
commit 6d36df6eca

View File

@@ -396,7 +396,8 @@ class PyGhidraLauncher:
Checks if the currently installed Ghidra version is supported. Checks if the currently installed Ghidra version is supported.
The launcher will report the problem and terminate if it is not supported. The launcher will report the problem and terminate if it is not supported.
""" """
if Version(self.app_info.version) < Version(MINIMUM_GHIDRA_VERSION): base_version = self.app_info.version.split('-')[0] # remove things like "-BETA"
if Version(base_version) < Version(MINIMUM_GHIDRA_VERSION):
msg = f"Ghidra version {self.app_info.version} is not supported" + os.linesep + \ msg = f"Ghidra version {self.app_info.version} is not supported" + os.linesep + \
f"The minimum required version is {MINIMUM_GHIDRA_VERSION}" f"The minimum required version is {MINIMUM_GHIDRA_VERSION}"
self._report_fatal_error("Unsupported Version", msg, ValueError(msg)) self._report_fatal_error("Unsupported Version", msg, ValueError(msg))
@@ -744,7 +745,7 @@ def _run_mac_app():
return res return res
CFRunLoopTimerCallback = CFUNCTYPE(None, c_void_p, c_void_p) CFRunLoopTimerCallback = CFUNCTYPE(None, c_void_p, c_void_p)
kCFRunLoopDefaultMode = c_void_p.in_dll(CoreFoundation, "kCFRunLoopDefaultMode") kCFRunLoopDefaultMode = c_void_p.in_dll(CoreFoundation, "kCFRunLoopDefaultMode") # @UndefinedVariable
kCFRunLoopRunFinished = c_int32(1) kCFRunLoopRunFinished = c_int32(1)
NULL = c_void_p(0) NULL = c_void_p(0)
INF_TIME = c_double(1.0e20) INF_TIME = c_double(1.0e20)