1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-12-22 16:42:11 +00:00

host: improve Windows EXE build generation

A virtual environment is now created and used to generate the EXE build, which helps to keep its size down to ~10 MiB.
This commit is contained in:
Pablo Curiel 2023-06-04 20:45:17 +02:00
parent 158d7c1e92
commit 0e17edace1
2 changed files with 22 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
.vscode
build
host/__pycache__
host/installer
host/build
host/dist
host/nxdumptool

View file

@ -1,8 +1,28 @@
pyinstaller -y --clean --log-level WARN -F --add-binary "C:\Windows\System32\libusb0.dll;." -w -i nxdt.ico nxdt_host.py
@echo off
set scriptdir=%~dp0
set scriptdir=%scriptdir:~0,-1%
set venvname=installer
set venvscripts=%scriptdir%\%venvname%\Scripts
set venvpython=%venvscripts%\python.exe
set venvpyinstaller=%venvscripts%\pyinstaller.exe
cd /D "%scriptdir%"
python -m venv "%venvname%"
"%venvpython%" -m pip install --upgrade pyinstaller -r requirements-win32.txt
"%venvpyinstaller%" -y --clean --log-level WARN -F --add-binary "C:\Windows\System32\libusb0.dll;." -w -i nxdt.ico nxdt_host.py
move dist\nxdt_host.exe nxdt_host.exe
rmdir /s /q __pycache__
rmdir /s /q build
rmdir /s /q dist
rmdir /s /q installer
del nxdt_host.spec
pause