Skip to content

Commit 7441267

Browse files
author
piotrj
committed
fix dnd with pyinstaller
1 parent c728654 commit 7441267

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

scripts/pyinstaller.run.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
@echo.
2323
@echo running-pyinstaller-stage_librer
24-
pyinstaller --version-file=version.pi.librer.txt --noconfirm --clean --add-data="distro.info.txt:." --add-data="version.txt;." --add-data="../LICENSE;." --icon=icon.ico --distpath=%OUTDIR% --windowed --contents-directory=internal librer.py || exit /b 2
24+
pyinstaller --version-file=version.pi.librer.txt --noconfirm --clean --add-data="distro.info.txt:." --add-data="version.txt;." --add-data="../LICENSE;." --icon=icon.ico --distpath=%OUTDIR% --windowed --contents-directory=internal --additional-hooks-dir=. --collect-binaries tkinterdnd2 librer.py || exit /b 2
2525

2626
@echo.
2727
@echo running-pyinstaller-stage_record

scripts/pyinstaller.run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo pyinstaller `pyinstaller --version` >> distro.info.txt
2121

2222
echo ''
2323
echo running-pyinstaller-stage_librer
24-
pyinstaller --strip --noconfirm --noconsole --clean --add-data="distro.info.txt:." --add-data="version.txt:." --add-data="../LICENSE:." --contents-directory=internal --distpath=$outdir ./librer.py
24+
pyinstaller --strip --noconfirm --noconsole --clean --add-data="distro.info.txt:." --add-data="version.txt:." --add-data="../LICENSE:." --contents-directory=internal --distpath=$outdir --additional-hooks-dir=. --collect-binaries tkinterdnd2 ./librer.py
2525

2626
echo ''
2727
echo running-pyinstaller-stage_record

src/hook-tkinterdnd2.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""pyinstaller hook file.
2+
3+
You need to use this hook-file if you are packaging a project using tkinterdnd2.
4+
Just put hook-tkinterdnd2.py in the same directory where you call pyinstaller and type:
5+
6+
pyinstaller myproject/myproject.py --additional-hooks-dir=.
7+
"""
8+
9+
from PyInstaller.utils.hooks import collect_data_files, eval_statement
10+
11+
12+
datas = collect_data_files('tkinterdnd2')

0 commit comments

Comments
 (0)