-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_windows.bat
More file actions
85 lines (77 loc) · 2.83 KB
/
build_windows.bat
File metadata and controls
85 lines (77 loc) · 2.83 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
79
80
81
82
83
84
85
@echo off
:: ============================================================
:: build_windows.bat
:: Builds TeamsAlive into a single-file installer for Windows.
:: No Python required on the end-user's machine.
::
:: Prerequisites (only needed on YOUR build machine):
:: 1. Python 3.9+ (python.org)
:: 2. Run this script – it installs everything else automatically
:: ============================================================
setlocal enabledelayedexpansion
title TeamsAliveWin – Windows Build
echo.
echo =============================================
echo TeamsAliveWin ^| Windows Build Script
echo =============================================
echo.
:: ── 1. Check Python ─────────────────────────────────────────
python --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Python not found. Install from https://python.org
pause & exit /b 1
)
echo [OK] Python found
:: ── 2. Install / upgrade dependencies ───────────────────────
echo [..] Installing dependencies...
python -m pip install --upgrade pip --quiet
python -m pip install pyinstaller pyautogui Pillow pystray --quiet
if errorlevel 1 ( echo [ERROR] pip install failed & pause & exit /b 1 )
echo [OK] Dependencies installed
:: ── 3. PyInstaller – one-file EXE (Python bundled inside) ───
echo [..] Building standalone EXE...
python -m PyInstaller ^
--onefile ^
--windowed ^
--noconfirm ^
--clean ^
--name TeamsAliveWin ^
--icon "icon.ico" ^
--add-data "icon.ico;." ^
--add-data "icon.png;." ^
--hidden-import pystray._win32 ^
--hidden-import PIL._tkinter_finder ^
teams_alive.py
if errorlevel 1 ( echo [ERROR] PyInstaller failed & pause & exit /b 1 )
echo [OK] dist\TeamsAliveWin.exe created
:: ── 4. NSIS installer (Look in PATH then common install folders) ─────
set MAKENSIS_BIN=makensis
where %MAKENSIS_BIN% >nul 2>&1
if errorlevel 1 (
if exist "C:\Program Files (x86)\NSIS\makensis.exe" (
set MAKENSIS_BIN="C:\Program Files (x86)\NSIS\makensis.exe"
) else (
echo [SKIP] NSIS not found – skipping installer.
echo If you just installed it, restart your PC.
goto :done
)
)
echo [..] Building NSIS installer...
%MAKENSIS_BIN% installer.nsi
if errorlevel 1 (
echo [WARN] NSIS build failed – check installer.nsi for errors.
) else (
echo [OK] TeamsAliveWin-Setup.exe created
)
:done
echo.
echo =============================================
echo Build complete!
echo.
echo Standalone EXE : dist\TeamsAliveWin.exe
echo Setup installer: TeamsAliveWin-Setup.exe (if NSIS was available)
echo.
echo Both run on any Windows 10/11 PC with no Python required.
echo =============================================
echo.
pause