| 1 | # Windows Package Builder |
| 2 | |
| 3 | Automated build system for creating Windows portable packages of Pixelle-Video. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | ### Prerequisites |
| 8 | |
| 9 | - Python 3.11+ (for running the build script) |
| 10 | - PyYAML: `pip install pyyaml` |
| 11 | - Internet connection (for downloading Python, FFmpeg, etc.) |
| 12 | |
| 13 | ### Build Package |
| 14 | |
| 15 | ```bash |
| 16 | # Basic build |
| 17 | python packaging/windows/build.py |
| 18 | |
| 19 | # Build with China mirrors (faster in China) |
| 20 | python packaging/windows/build.py --cn-mirror |
| 21 | |
| 22 | # Custom output directory |
| 23 | python packaging/windows/build.py --output /path/to/output |
| 24 | ``` |
| 25 | |
| 26 | ## Configuration |
| 27 | |
| 28 | Edit `config/build_config.yaml` to customize: |
| 29 | |
| 30 | - Python version |
| 31 | - FFmpeg version |
| 32 | - Excluded files/folders |
| 33 | - Build options |
| 34 | - Mirror settings |
| 35 | |
| 36 | ## Output |
| 37 | |
| 38 | The build process creates: |
| 39 | |
| 40 | ``` |
| 41 | dist/windows/ |
| 42 | ├── Pixelle-Video-v*-win64/ # Build directory (version number varies) |
| 43 | │ ├── python/ # Python embedded |
| 44 | │ ├── tools/ # FFmpeg, etc. |
| 45 | │ ├── Pixelle-Video/ # Project files |
| 46 | │ ├── data/ # User data (empty) |
| 47 | │ ├── output/ # Output (empty) |
| 48 | │ ├── start.bat # Main launcher |
| 49 | │ ├── start_api.bat # API launcher |
| 50 | │ ├── start_web.bat # Web launcher |
| 51 | │ └── README.txt # User guide |
| 52 | ├── Pixelle-Video-v*-win64.zip # ZIP package (version number varies) |
| 53 | └── Pixelle-Video-v*-win64.zip.sha256 # Checksum (version number varies) |
| 54 | ``` |
| 55 | |
| 56 | ## Build Process |
| 57 | |
| 58 | The builder performs these steps: |
| 59 | |
| 60 | 1. **Download Phase** |
| 61 | - Python embedded distribution |
| 62 | - FFmpeg portable |
| 63 | - Cached in `.cache/` for reuse |
| 64 | |
| 65 | 2. **Extract Phase** |
| 66 | - Extract Python to `build/python/` |
| 67 | - Extract FFmpeg to `build/tools/ffmpeg/` |
| 68 | |
| 69 | 3. **Prepare Phase** |
| 70 | - Enable site-packages in Python |
| 71 | - Install pip |
| 72 | - Install uv (if configured) |
| 73 | |
| 74 | 4. **Install Phase** |
| 75 | - Install project dependencies using uv/pip |
| 76 | - Pre-install all packages |
| 77 | |
| 78 | 5. **Copy Phase** |
| 79 | - Copy project files (excluding test/docs/cache) |
| 80 | - Generate launcher scripts from templates |
| 81 | - Create empty directories |
| 82 | |
| 83 | 6. **Package Phase** |
| 84 | - Create ZIP archive |
| 85 | - Generate SHA256 checksum |
| 86 | |
| 87 | ## Templates |
| 88 | |
| 89 | Launcher script templates in `templates/`: |
| 90 | |
| 91 | - `start.bat` - Main Web UI launcher |
| 92 | - `start_api.bat` - API server launcher |
| 93 | - `start_web.bat` - Web UI only launcher |
| 94 | - `README.txt` - User documentation |
| 95 | |
| 96 | Templates support placeholders: |
| 97 | - `{VERSION}` - Project version |
| 98 | - `{BUILD_DATE}` - Build timestamp |
| 99 | |
| 100 | ## Cache |
| 101 | |
| 102 | Downloaded files are cached in `.cache/`: |
| 103 | |
| 104 | ``` |
| 105 | .cache/ |
| 106 | ├── python-3.11.9-embed-amd64.zip |
| 107 | ├── ffmpeg-6.1.1-win64.zip |
| 108 | └── get-pip.py |
| 109 | ``` |
| 110 | |
| 111 | Delete cache to force re-download. |
| 112 | |
| 113 | ## Troubleshooting |
| 114 | |
| 115 | ### Build fails with "PyYAML not found" |
| 116 | |
| 117 | ```bash |
| 118 | pip install pyyaml |
| 119 | ``` |
| 120 | |
| 121 | ### Downloads are slow |
| 122 | |
| 123 | Use China mirrors: |
| 124 | |
| 125 | ```bash |
| 126 | python build.py --cn-mirror |
| 127 | ``` |
| 128 | |
| 129 | ### Dependencies installation fails |
| 130 | |
| 131 | Check: |
| 132 | 1. Internet connection |
| 133 | 2. PyPI mirrors accessibility |
| 134 | 3. Project dependencies in `pyproject.toml` |
| 135 | |
| 136 | ### ZIP creation fails |
| 137 | |
| 138 | Ensure: |
| 139 | 1. Sufficient disk space |
| 140 | 2. Write permissions to output directory |
| 141 | 3. No files are locked by other processes |
| 142 | |
| 143 | ## Advanced Usage |
| 144 | |
| 145 | ### Custom Configuration |
| 146 | |
| 147 | Create custom config file: |
| 148 | |
| 149 | ```bash |
| 150 | cp config/build_config.yaml config/my_config.yaml |
| 151 | # Edit my_config.yaml |
| 152 | python build.py --config config/my_config.yaml |
| 153 | ``` |
| 154 | |
| 155 | ### Skip ZIP Creation |
| 156 | |
| 157 | Edit `build_config.yaml`: |
| 158 | |
| 159 | ```yaml |
| 160 | build: |
| 161 | create_zip: false |
| 162 | ``` |
| 163 | |
| 164 | ### Include Chrome Portable |
| 165 | |
| 166 | Edit `build_config.yaml`: |
| 167 | |
| 168 | ```yaml |
| 169 | chrome: |
| 170 | include: true |
| 171 | download_url: "https://path/to/chrome-portable.zip" |
| 172 | ``` |
| 173 | |
| 174 | ## Maintenance |
| 175 | |
| 176 | ### Update Python Version |
| 177 | |
| 178 | Edit `config/build_config.yaml`: |
| 179 | |
| 180 | ```yaml |
| 181 | python: |
| 182 | version: "3.11.10" |
| 183 | download_url: "https://www.python.org/ftp/python/3.11.10/python-3.11.10-embed-amd64.zip" |
| 184 | ``` |
| 185 | |
| 186 | ### Update FFmpeg Version |
| 187 | |
| 188 | Edit `config/build_config.yaml`: |
| 189 | |
| 190 | ```yaml |
| 191 | ffmpeg: |
| 192 | version: "6.2.0" |
| 193 | download_url: "https://github.com/BtbN/FFmpeg-Builds/releases/download/..." |
| 194 | ``` |
| 195 | |
| 196 | ## Distribution |
| 197 | |
| 198 | To distribute the package: |
| 199 | |
| 200 | 1. Upload ZIP file to release page |
| 201 | 2. Include SHA256 checksum for verification |
| 202 | 3. Provide installation instructions |
| 203 | |
| 204 | Users verify download: |
| 205 | |
| 206 | ```bash |
| 207 | # Windows PowerShell |
| 208 | Get-FileHash Pixelle-Video-v*-win64.zip -Algorithm SHA256 |
| 209 | ``` |
| 210 | |
| 211 | Compare with `.sha256` file. |
| 212 | |
| 213 | ## License |
| 214 | |
| 215 | Same as Pixelle-Video project license. |
| 216 | |
| 217 |