Files
simple/setup.bat
T
catarrh 5cea89cc66 docs: both install paths (release package / clone) + Windows notes refreshed
The READMEs told users to clone the repository even though most just
want to run the app.  The Quick start now leads with the release
package (a snapshot of the tagged source: no git history, no
development files) and keeps the clone path for development or
unreleased changes; git is still required because setup installs pysim
from its upstream repository.

Windows notes refreshed against the actual tooling and PyPI:
- pyscard 2.3.1 ships cp39-cp313 wheels (no cp314) and requires
  Python >= 3.9, so the pip/pyproject floor is 3.9 now (3.8 could
  never install the dependency) and the "3.9 builds from source" note
  is gone - only 3.14 does.
- The reader sentence now describes what actually happens: start.sh
  asks for the first PC/SC reader when pcscd runs, the server
  auto-detects a PC/SC reader itself, and with none present pysim
  falls back to its serial default /dev/ttyUSB0 (use -d for a
  serial/FTDI reader).
- The manual-install block is marked Linux/macOS: on Windows pysim is
  installed via requirements-pysim.txt + --no-deps (setup.bat), since
  the plain pip route pulls the SMPP bridge and its MSVC chain.

Docs/metadata only: 953 frontend + 989 Python green.
2026-10-20 23:23:31 +03:00

86 lines
2.1 KiB
Batchfile

@echo off
REM pysim-simple-server setup script for Windows
REM Creates a venv and installs pysim and its dependencies.
setlocal enabledelayedexpansion
set VENV_DIR=%~dp0.venv
echo === pysim-simple-server setup ===
echo.
REM Check Python
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo Error: Python is required but not found.
echo Install Python 3.9+ from https://python.org
pause
exit /b 1
)
echo Found Python
python --version
REM Check Git
git --version >nul 2>&1
if %errorlevel% neq 0 (
echo Error: Git is required but not found.
echo Install Git from https://git-scm.com
pause
exit /b 1
)
echo Found Git
git --version
echo.
REM Create venv
if not exist "%VENV_DIR%" (
echo Creating virtual environment...
python -m venv "%VENV_DIR%"
)
call "%VENV_DIR%\Scripts\activate.bat"
REM Upgrade pip
python -m pip install --upgrade pip -q
REM pyscard has precompiled wheels for Python 3.9-3.13.
REM On Python 3.14 pip builds it from source (requires Microsoft C++ Build Tools).
echo Note: pyscard ships precompiled wheels for Python 3.9-3.13.
echo Python 3.14 will build pyscard from source and require
echo Microsoft C++ Build Tools ("Desktop development with C++").
echo.
REM Install pysim dependencies first, then pysim itself (without the SMPP
REM bridge - not needed by pysim-shell). Installing pysim with --no-deps after
REM its dependencies avoids pip's resolver warning about the intentionally
REM omitted smpp.twisted3 (SMPP bridge) dependency.
echo === Installing pysim dependencies ===
pip install -r "%~dp0requirements-pysim.txt"
if %errorlevel% neq 0 (
echo Error: Failed to install pysim dependencies.
pause
exit /b 1
)
echo === Installing pysim ===
pip install --no-deps git+https://github.com/osmocom/pysim.git
if %errorlevel% neq 0 (
echo Error: Failed to install pysim.
pause
exit /b 1
)
echo.
REM Install pysim-simple-server
echo === Installing pysim-simple-server ===
pip install -e "%~dp0."
if %errorlevel% neq 0 (
echo Error: Failed to install pysim-simple-server.
pause
exit /b 1
)
echo.
echo === Setup complete ===
echo Run start.bat to start the server.
pause