@echo off rem ============================================================================ rem Guanlan pack.bat - build the delivery package (zip). rem rem ASCII ONLY ON PURPOSE (see docs section 11.3): Chinese text in a .bat is rem codepage-dependent and cmd.exe has been seen to execute parts of it. rem rem What the package contains: program + configs + pages/assets + offline rem wheels + vendor runtime + delivery docs + the install/start/stop/pack rem scripts. What it does NOT contain (default, no flags needed): rem 1) input data data/ (field raw files) rem 2) products outputs/ (page data) rem 3) run logs logs/ run/ and any *.log / *.jsonl anywhere rem 4) temp files caches (*_cache, __pycache__), *.tmp *.bak* *.old rem *.orig *.rej *.swp *~ ~$* .DS_Store Thumbs.db rem rem Usage: rem pack.bat build the package (same as: python scripts\pack_dist.py) rem pack.bat dry show what would be packed, write nothing rem pack.bat verify open-box verify an already built zip rem pack.bat help this text rem rem Output: a .zip named guanlan-v[version]_dist_[date].zip, written next to the install dir. rem Details: README at install root, section "PACK / packaging" (Chinese) rem and docs\??????.md section 9 (delivery package) rem ============================================================================ chcp 65001 >nul set PYTHONUTF8=1 cd /d "%~dp0" if not exist ".venv\Scripts\python.exe" ( echo [X] Not installed yet: .venv\Scripts\python.exe not found echo Run install.bat first. pause exit /b 2 ) if /i "%~1"=="help" goto help if /i "%~1"=="dry" goto dry if /i "%~1"=="-n" goto dry if /i "%~1"=="verify" goto verify echo [i] Building the delivery package (no data / no products / no logs / no temp) ... ".venv\Scripts\python.exe" scripts\pack_dist.py %* set RC=%ERRORLEVEL% echo. if not "%RC%"=="0" ( echo [X] Packaging failed, exit code %RC%. See the output above. ) else ( echo [i] Done. Copy the .zip printed above to the target machine, then run echo install.bat there, then check.bat, then start.bat. ) pause exit /b %RC% :dry echo [i] Dry run - showing what would be packed, nothing is written. ".venv\Scripts\python.exe" scripts\pack_dist.py --dry-run pause exit /b 0 :verify if "%~2"=="" ( echo [i] Usage: pack.bat verify [path\to\package.zip] echo With no path, the newest guanlan-v*_dist_*.zip next to the install dir is used. ) ".venv\Scripts\python.exe" scripts\pack_verify_entry.py %2 pause exit /b 0 :help echo Usage: echo pack.bat build the delivery package (zip) echo pack.bat dry show what would be packed, write nothing echo pack.bat verify [zip] open-box verify: extract + offline install + page probe echo pack.bat help this text echo Excluded by default: input data (data\), products (outputs\), logs (logs\, run\, echo any *.log/*.jsonl), temp files (caches, *.tmp, *.bak*, *~, ~$*, .DS_Store ...). echo See README at the install root, section PACK. exit /b 0