Skip to content

Commit

Permalink
Added support for pyinstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoboss committed Jan 2, 2023
1 parent ad358da commit e5d35f9
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dev/PyInstallerBuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pip3 install -r ./requirements-pyinstaller.txt
cd ../nsz
rm -rf build
rm -rf dist
pyinstaller ./__init__.spec
cd dist/__init__
read -p "Press any key to test ..."
./nsz.exe
9 changes: 9 additions & 0 deletions dev/requirements-pyinstaller.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pycryptodome
zstandard
enlighten
pywin32;platform_system == "Windows"
pypiwin32;platform_system == "Windows"
kivy
opencv-python
pyenchant
pyinstaller
47 changes: 47 additions & 0 deletions nsz/__init__.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- mode: python ; coding: utf-8 -*-

from kivy_deps import sdl2, glew
import cv2
import enchant
block_cipher = None

a = Analysis(['__init__.py'],
pathex=['C:\\Users\\Administrator\\Documents\\nsz\\nsz'],
binaries=[],
datas=[
('gui/json/*.json', 'nsz/gui/json'),
('gui/layout/*.kv', 'nsz/gui/layout'),
('gui/shaders/*.shader', 'nsz/gui/shaders'),
('gui/fonts/*', 'nsz/gui/fonts'),
('gui/txt/*.txt', 'nsz/gui/txt'),
('gui/nsZip.png', 'nsz/gui/nsZip.png')],
hiddenimports=['win32timezone'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='nsz',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
*[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
strip=False,
upx=True,
upx_exclude=[],
name='__init__')

0 comments on commit e5d35f9

Please sign in to comment.