Skip to content

Commit

Permalink
fix dnd with pyinstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrj committed Apr 15, 2024
1 parent c728654 commit 7441267
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/pyinstaller.run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

@echo.
@echo running-pyinstaller-stage_librer
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
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

@echo.
@echo running-pyinstaller-stage_record
Expand Down
2 changes: 1 addition & 1 deletion scripts/pyinstaller.run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ echo pyinstaller `pyinstaller --version` >> distro.info.txt

echo ''
echo running-pyinstaller-stage_librer
pyinstaller --strip --noconfirm --noconsole --clean --add-data="distro.info.txt:." --add-data="version.txt:." --add-data="../LICENSE:." --contents-directory=internal --distpath=$outdir ./librer.py
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

echo ''
echo running-pyinstaller-stage_record
Expand Down
12 changes: 12 additions & 0 deletions src/hook-tkinterdnd2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""pyinstaller hook file.
You need to use this hook-file if you are packaging a project using tkinterdnd2.
Just put hook-tkinterdnd2.py in the same directory where you call pyinstaller and type:
pyinstaller myproject/myproject.py --additional-hooks-dir=.
"""

from PyInstaller.utils.hooks import collect_data_files, eval_statement


datas = collect_data_files('tkinterdnd2')

0 comments on commit 7441267

Please sign in to comment.