mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
tp.py: setup: refactor lmgr326b.dll copy, and also do it for 1.2.5e
This commit is contained in:
+14
-16
@@ -202,14 +202,12 @@ def setup(debug: bool, game_path: Path, tools_path: Path):
|
|||||||
)
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
c27_lmgr326b = c27.joinpath("Lmgr326b.dll")
|
c27_lmgr326b = None
|
||||||
if not c27_lmgr326b.exists() or not c27_lmgr326b.is_file():
|
for name in os.listdir(c27):
|
||||||
c27_lmgr326b = c27.joinpath("lmgr326b.dll")
|
if name.lower() == "lmgr326b.dll":
|
||||||
if not c27_lmgr326b.exists() or not c27_lmgr326b.is_file():
|
c27_lmgr326b = c27.joinpath(name)
|
||||||
c27_lmgr326b = c27.joinpath("LMGR326B.dll")
|
break
|
||||||
if not c27_lmgr326b.exists() or not c27_lmgr326b.is_file():
|
if not c27_lmgr326b or not c27_lmgr326b.is_file():
|
||||||
c27_lmgr326b = c27.joinpath("LMGR326B.DLL")
|
|
||||||
if not c27_lmgr326b.exists() or not c27_lmgr326b.is_file():
|
|
||||||
LOG.error(
|
LOG.error(
|
||||||
(
|
(
|
||||||
f"Unable to find 'lmgr326b.dll' in '{c27}': missing file '{c27_lmgr326b}'\n"
|
f"Unable to find 'lmgr326b.dll' in '{c27}': missing file '{c27_lmgr326b}'\n"
|
||||||
@@ -218,15 +216,15 @@ def setup(debug: bool, game_path: Path, tools_path: Path):
|
|||||||
)
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
c27_lmgr326b_cc = c27.joinpath("LMGR326B.dll")
|
def copy_lmgr326b(path: Path):
|
||||||
if not c27_lmgr326b_cc.exists() or not c27_lmgr326b_cc.is_file():
|
lmgr326b_cc = path.joinpath("LMGR326B.dll")
|
||||||
LOG.debug(f"copy: '{c27_lmgr326b}', to: '{c27_lmgr326b_cc}'")
|
if not lmgr326b_cc.is_file():
|
||||||
shutil.copy(c27_lmgr326b, c27_lmgr326b_cc)
|
LOG.debug(f"copy: '{c27_lmgr326b}', to: '{lmgr326b_cc}'")
|
||||||
|
shutil.copy(c27_lmgr326b, lmgr326b_cc)
|
||||||
|
|
||||||
c125_lmgr326b_cc = c125.joinpath("LMGR326B.dll")
|
copy_lmgr326b(c27)
|
||||||
if not c125_lmgr326b_cc.exists() or not c125_lmgr326b_cc.is_file():
|
copy_lmgr326b(c125)
|
||||||
LOG.debug(f"copy: '{c27_lmgr326b}', to: '{c125_lmgr326b_cc}'")
|
copy_lmgr326b(c125e)
|
||||||
shutil.copy(c27_lmgr326b, c125_lmgr326b_cc)
|
|
||||||
|
|
||||||
c27_mwcceppc = c27.joinpath("mwcceppc.exe")
|
c27_mwcceppc = c27.joinpath("mwcceppc.exe")
|
||||||
if not c27_mwcceppc.exists() or not c27_mwcceppc.is_file():
|
if not c27_mwcceppc.exists() or not c27_mwcceppc.is_file():
|
||||||
|
|||||||
Reference in New Issue
Block a user