okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
3616148bb
main
1@echo off 2rem Strata for Windows: the first run installs everything and starts the model; later runs just start it. 3rem Needs only an NVIDIA or AMD graphics driver. Python is installed for your user account if it is missing (no admin needed). 4set local 5rem Python reads and writes text as UTF-8, not in the Windows code page (cp1251, cp866, ...): a folder or user name with Cyrillic or other letters stays intact (#3202). 6set "PYTHONUTF8=1" 7title Strata 8cd / d "%~dp0" 9rem A bundled Python runtime (the python\ folder of the terminal archive) is used when it is there: nothing to find, 10rem install or download. SETUP.bat and UPDATE.bat run this file, so they use it too. 11if exist "python\python.exe" goto bundled 12if exist ".venv\Scripts\python.exe" goto run 13 14call :findpy 15if defined PY goto venv 16echo . 17echo Python 3 .10 or newer is not installed .Installing Python 3 .12 for your user account ... 18where winget > nul 2 >nul 19if errorlevel 1 goto pyorg 20winget install - e -- id Python . Python . 3 .12 --scope user --silent --source winget --accept -package -agreements --accept -source -agreements --disable -interactivity 21call :findpy 22ifdefined PY gotovenv 23:pyorg 24echoDownloading the Python installer from python .org ... 25powershell -NoProfile -ExecutionPolicy Bypass -Command "[Net .ServicePointManager ]::SecurityProtocol ='Tls12 ';Invoke -WebRequest -UseBasicParsing https ://www .python .org /ftp /python /3 .12 .10 /python -3 .12 .10 -amd64 .exe -OutFile \"$env :TEMP \strata -python -setup .exe \"" 26ifexist "%TEMP %\strata -python -setup .exe " "%TEMP %\strata -python -setup .exe " /quiet InstallAllUsers =0 PrependPath =1 Include_launcher =1 Include_test =0 27call :findpy 28ifdefined PY gotovenv 29echo. 30echoPython could not be installed automatically . 31echoInstall 64 -bit Python 3 .12 from https ://www .python .org /downloads / ("Add python .exe to PATH"), 32echothen double -click START-HERE .bat again . 33pause 34exit /b 1 35 36:venv 37rema private environment inside this folder ,so nothing is installed into the system Python 38%PY % -m venv .venv 39ifexist ".venv \Scripts \python .exe " gotorun 40echoCould not create the Python environment in .venv 41pause 42exit /b 1 43 44:bundled 45set "PYTHONNOUSERSITE =1 " 46set "PYTHONHOME =" 47set "PYTHONPATH =" 48"python \python .exe "setup .py %* 49iferrorlevel 1 pause 50exit /b 51 52:run 53".venv \Scripts \python .exe "setup .py %* 54iferrorlevel 1 pause 55exit /b 56 57:findpy 58remthe py launcher first ,then python on PATH (not the Microsoft Store stub ),then the usual per -user folders 59set "PY =" 60py -3 -c "import sys ;sys .exit(0 ifsys .version_info >= (3 ,10 )and sys .maxsize >2 **32 else 1 )" >nul 2 >nul 61ifnot errorlevel 1 set "PY =py -3 " & goto :eof 62python -c "import sys ;sys .exit(0 ifsys .version_info >= (3 ,10 )and sys .maxsize >2 **32 else 1 )" >nul 2 >nul 63ifnot errorlevel 1 set "PY =python " & goto :eof 64for %%V in (313 312 311 310 )do ifexist "%LOCALAPPDATA %\Programs \Python \Python %%V \python .exe " set "PY ="%LOCALAPPDATA %\Programs \Python \Python %%V \python .exe "" & goto :eof 65goto :eof