diff --git a/.gitignore b/.gitignore index 0a5d8271..8c0029f0 100644 --- a/.gitignore +++ b/.gitignore @@ -251,4 +251,7 @@ compile_commands.json .TagStudio TagStudio.ini + + + # End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,python,qt diff --git a/Build_win.bat b/Build_win.bat new file mode 100644 index 00000000..3e99fdcf --- /dev/null +++ b/Build_win.bat @@ -0,0 +1,31 @@ +@echo off +set TAGSTUDIO_NAME=TagStudio +set TAGSTUDIO_DIR=tagstudio +set TAGSTUDIO_DIR_RESOURCES=%TAGSTUDIO_DIR%/resources +set TAGSTUDIO_ICON=%TAGSTUDIO_DIR%/resources/icon.ico +set TAGSTUDIO_SRC=%TAGSTUDIO_DIR%/src +set TAGSTUDIO_MAIN=%TAGSTUDIO_DIR%/tag_studio.py +set BUILD_MODE=--onedir + + +if "%1" == "--help" ( + echo run "%~nx0" for normal Build + echo run "%~nx0 --portable" for Build packaged into one file + goto end +) +if "%1" == "--portable" ( + echo Building portable executable... + set BUILD_MODE=--onefile + goto run +) +if not "%1" == "" ( + echo Invalid argument run "%~nx0 --help" for help + goto end +) +:run +echo Building executable... +set COMMAND=PyInstaller --name "%TAGSTUDIO_NAME%" --icon "%TAGSTUDIO_ICON%" --add-data "%TAGSTUDIO_DIR_RESOURCES%:./resources" --add-data "%TAGSTUDIO_SRC%:./src" -p "%TAGSTUDIO_DIR%" --console %BUILD_MODE% "%TAGSTUDIO_MAIN%" -y +call .venv\Scripts\activate.bat +%COMMAND% +deactivate +:end diff --git a/requirements.txt b/requirements.txt index 0456b920..7c1b4c35 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ PySide6_Addons>=6.5.1.1,<=6.6.3.1 PySide6_Essentials>=6.5.1.1,<=6.6.3.1 typing_extensions>=3.10.0.0,<=4.11.0 ujson>=5.8.0,<=5.9.0 +Pyinstaller==6.6.0