Move redist tools to central location

This commit is contained in:
disinvite 2023-12-15 16:37:47 -05:00
parent 540a930494
commit 9657002df3
7 changed files with 17 additions and 7 deletions

View File

@ -0,0 +1,13 @@
"""Provides a reference point for redistributed tools found in this directory.
This allows you to get the path for these tools from a script run anywhere."""
from os.path import join, dirname
def lib_path() -> str:
"""Returns the directory for this module."""
return dirname(__file__)
def lib_path_join(name: str) -> str:
"""Convenience wrapper for os.path.join."""
return join(lib_path(), name)

View File

@ -1,6 +1,6 @@
import os
import subprocess
from .utils import get_file_in_script_dir
from isledecomp.lib import lib_path_join
class RecompiledInfo:
@ -18,7 +18,7 @@ class SymInfo:
def __init__(self, pdb, sym_recompfile, sym_logger, sym_wine_path_converter=None):
self.logger = sym_logger
call = [get_file_in_script_dir("cvdump.exe"), "-l", "-s"]
call = [lib_path_join("cvdump.exe"), "-l", "-s"]
if sym_wine_path_converter:
# Run cvdump through wine and convert path to Windows-friendly wine path

View File

@ -4,8 +4,8 @@
import difflib
import subprocess
import os
import sys
from isledecomp.lib import lib_path_join
from isledecomp.utils import print_diff
@ -32,11 +32,8 @@ def main():
if not os.path.isfile(args.recompiled):
parser.error(f"Recompiled binary {args.recompiled} does not exist")
def get_file_in_script_dir(fn):
return os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), fn)
def get_exports(file):
call = [get_file_in_script_dir("DUMPBIN.EXE"), "/EXPORTS"]
call = [lib_path_join("DUMPBIN.EXE"), "/EXPORTS"]
if os.name != "nt":
call.insert(0, "wine")