-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
78 lines (67 loc) · 2.12 KB
/
Copy pathbuild.bat
File metadata and controls
78 lines (67 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@echo off
setlocal enabledelayedexpansion
title SquishIt Builder
echo ============================================
echo SquishIt - Build Script
echo ============================================
echo.
:: Check Python
python --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Python not found. Install from https://python.org
pause
exit /b 1
)
:: Install dependencies
echo [1/3] Installing Python dependencies...
pip install flask pyinstaller --quiet
if errorlevel 1 (
echo ERROR: pip install failed.
pause
exit /b 1
)
:: Download ffmpeg if not present
if not exist "ffmpeg\ffmpeg.exe" (
echo [2/3] Downloading ffmpeg ^(this may take a minute^)...
mkdir ffmpeg 2>nul
powershell -Command "& { $url = 'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip'; $out = 'ffmpeg_tmp.zip'; Invoke-WebRequest -Uri $url -OutFile $out -UseBasicParsing }"
if not exist "ffmpeg_tmp.zip" (
echo ERROR: Could not download ffmpeg. Check your internet connection.
pause
exit /b 1
)
echo Extracting ffmpeg...
powershell -Command "& { Expand-Archive -Path 'ffmpeg_tmp.zip' -DestinationPath 'ffmpeg_extracted' -Force }"
for /d %%d in (ffmpeg_extracted\ffmpeg-*) do (
copy "%%d\bin\ffmpeg.exe" "ffmpeg\" >nul
copy "%%d\bin\ffprobe.exe" "ffmpeg\" >nul
)
del ffmpeg_tmp.zip
rmdir /s /q ffmpeg_extracted
if not exist "ffmpeg\ffmpeg.exe" (
echo ERROR: ffmpeg extraction failed.
pause
exit /b 1
)
echo ffmpeg downloaded successfully.
) else (
echo [2/3] ffmpeg already present, skipping download.
)
:: Build single-file exe
echo [3/3] Building SquishIt.exe ^(single file, may take a few minutes^)...
pyinstaller squishit.spec --noconfirm --clean --onefile
if errorlevel 1 (
echo ERROR: PyInstaller build failed.
pause
exit /b 1
)
echo.
echo ============================================
echo BUILD COMPLETE!
echo ============================================
echo.
echo Single file: dist\SquishIt.exe
echo Send just that one file to your friends!
echo Double-click to run - no installs needed.
echo.
pause