-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathzip_script.py
More file actions
24 lines (18 loc) · 783 Bytes
/
zip_script.py
File metadata and controls
24 lines (18 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from zipfile import ZipFile, ZIP_DEFLATED
import glob
import sys
from pathlib import Path
build_dir = Path(sys.argv[1]) if len(sys.argv) > 1 else Path('build')
executable_path = build_dir / 'CFGEditorPlusPlus.exe'
core_dlls = glob.glob(str(build_dir / 'Qt6*.dll'))
imageformats = glob.glob(str(build_dir / 'imageformats' / '*.dll'))
platforms = glob.glob(str(build_dir / 'platforms' / '*.dll'))
styles = glob.glob(str(build_dir / 'styles' / '*.dll'))
all_dlls = [*core_dlls, *imageformats, *platforms, *styles]
print(all_dlls)
with ZipFile('CFGEditor.zip', 'w', ZIP_DEFLATED) as zpf:
for dll in all_dlls:
zipname = str(Path(dll).relative_to(build_dir))
zpf.write(dll, arcname=zipname)
zpf.write(str(executable_path), arcname='CFGEditorPlusPlus.exe')
print('Zip created')