mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-25 05:36:02 +00:00

Loonycyborg already uses these tools with Python 3. The python launcher tool for Windows has magic handling for some shebang lines, however `#!/bin/env python` isn't recognised without the `/usr`. Had the `/usr` been included with the old code then these scripts would likely have been run with Python 2. https://docs.python.org/dev/using/windows.html#shebang-lines
19 lines
470 B
Python
Executable File
19 lines
470 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import pefile, pathlib, shutil
|
|
|
|
dlls = set()
|
|
dllpath = pathlib.Path('/windows/mingw64/bin')
|
|
pe_modules = set([pefile.PE('wesnoth.exe')])
|
|
|
|
while pe_modules:
|
|
pe = pe_modules.pop()
|
|
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
|
path = dllpath / pathlib.Path(entry.dll.decode())
|
|
if path not in dlls and path.exists():
|
|
dlls.add(path)
|
|
pe_modules.add(pefile.PE(path))
|
|
|
|
for dll in dlls:
|
|
shutil.copy(dll, ".")
|