Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
46dd3c1
launcher: a full overhaul of the Python launcher (LAUNCHER-OVERHAUL)
OreoFR Dec 2, 2026
2bb36a3
launcher: the mockup's look (Mandy palette, cards in two columns, rai…
OreoFR Dec 2, 2026
5287ec6
launcher: the look of #3064 (Mandy name, palette, rail picture, gener…
OreoFR Dec 2, 2026
0e275a0
launcher: the Settings page, rail and colours exactly as in the mockup
OreoFR Dec 2, 2026
83668f0
docs/launcher.md: no path outside the repository for the mockup
OreoFR Dec 2, 2026
f848e75
launcher: no picture file at all (the unused loader of assets/mandy.p…
OreoFR Dec 2, 2026
9b6746b
launcher: assets/mandy.png at the top of the rail again (MoonEyes' ca…
OreoFR Dec 2, 2026
73669be
launcher: no picture of Mandy, only the drawn background (OreoFR); Fr…
OreoFR Dec 2, 2026
3baaba9
launcher: a stray comma in the module's docstring
OreoFR Dec 2, 2026
3565b4e
launcher: fixes from the agent review of #3182
OreoFR Dec 2, 2026
9257c34
Merge origin/main into feat/launcher-overhaul (full precompilation by…
OreoFR Dec 2, 2026
4ae1a3c
ci: start the pull_request checks again (none ran while the branch co…
OreoFR Dec 2, 2026
6b7ff5e
launcher: PLAY drawn as a rounded violet-to-pink pill on the banner (…
OreoFR Dec 2, 2026
a385951
launcher: a plain banner behind PLAY (no drawn gradient, glow or fronds)
OreoFR Dec 2, 2026
661b450
launcher: the Play page in cards, with the updates and what is new; n…
OreoFR Dec 2, 2026
bf36bc0
launcher: one update per pull request merged (rev-list --first-parent…
OreoFR Dec 2, 2026
a269b42
launcher: Capture back in the diagnostics card; a diagnostic start do…
OreoFR Dec 2, 2026
009abfb
Launcher.bat: an update from the old launcher ends cleanly (it went o…
OreoFR Dec 2, 2026
79a4dc0
Launcher.bat: a failing launcher's exit code goes back to the caller …
OreoFR Dec 2, 2026
dcf0377
Launcher.bat: the whole error path on the launcher's line (merzleckei…
OreoFR Dec 2, 2026
be65367
launcher: the DLSS mode back in the Picture card
OreoFR Dec 2, 2026
5a29349
launcher: the pointer on PLAY no longer freezes the window
OreoFR Dec 2, 2026
00a35d6
launcher: greyed controls where another choice makes them pointless
OreoFR Dec 2, 2026
e9b947b
launcher: frame generation greyed with ray tracing only on Series X u…
OreoFR Dec 2, 2026
fe36566
Merge origin/main into feat/launcher-overhaul
OreoFR Dec 2, 2026
5143858
launcher: the update check runs at every start
OreoFR Dec 2, 2026
fa04912
launcher: frame generation greyed again whenever hardware ray tracing…
OreoFR Dec 2, 2026
540baab
launcher: polish pass (neutral night palette, one accent, no icon tiles)
OreoFR Dec 2, 2026
2d5ea7b
launcher: second polish pass on Mods, Saves, Tools, About and the rail
OreoFR Dec 2, 2026
dafad4c
Merge remote-tracking branch 'origin/main' into feat/launcher-overhaul
OreoFR Dec 2, 2026
2152ab8
launcher: show what the F1 menu saved; FG greying honours LEONIDA_FG_…
OreoFR Dec 2, 2026
5ee2cb1
launcher: warn when Windows' commit limit is too low for the Series X…
OreoFR Dec 2, 2026
7768d10
launcher: -Quality is 'Steady bodies' (it is not a picture setting); …
OreoFR Dec 2, 2026
64a2c01
launcher: batched output pump; the low-commit warning follows the F1 …
OreoFR Dec 2, 2026
018567d
launcher: frame generation multiplier, window shape and graphics card…
OreoFR Dec 2, 2026
ff1b78c
launcher: Advanced mode window with every LEONIDA_* variable of switc…
OreoFR Dec 2, 2026
c0813bd
launcher: Advanced mode value fields show a grey placeholder with the…
OreoFR Dec 2, 2026
dac5156
launcher: no value hint from a bare number (an example, not a format)
OreoFR Dec 2, 2026
c33166f
launcher: the Advanced mode's filters say what they keep (Only what I…
OreoFR Dec 2, 2026
3fcd5e4
launcher: the Series X memory note shows the limit to a tenth and say…
OreoFR Dec 2, 2026
0bbf39b
launcher: Picture in the window and Language as segmented buttons
OreoFR Dec 2, 2026
3386913
launcher: Import saves puts saves from another PC, an older install o…
OreoFR Dec 2, 2026
671d0c0
launcher: frame generation with hardware ray tracing follows play-nvi…
OreoFR Dec 3, 2026
fc981a3
Launcher.bat: the update's exit code survives the old-to-new rewrite …
OreoFR Dec 3, 2026
6ac3f87
tests: the launcher's switches.md check counts the LEONIDA_* rows, no…
OreoFR Dec 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 132 additions & 19 deletions Launcher.bat
Original file line number Diff line number Diff line change
@@ -1,26 +1,139 @@
@echo off
title Leonida - Launcher
rem Double-click to open the launcher window: play, settings, mods, tools. It never touches the game package.
rem cmd reads a batch file line by line from the byte where it stopped: when the launcher's Update replaces this
rem file while it runs, cmd goes on at that byte of the new file. The :: lines below (labels: cmd skips them, from
rem any byte) cover where the older Launcher.bat stopped (byte 749), and lead to a clean exit. Keep them.
goto :start
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
exit /b
:start
title Leonida - Launcher
rem It needs Python 3.12 or newer with Tcl/Tk (the window). Without one it offers to install Python 3.12 for this
rem user (no admin), as Build.bat does. LEONIDA_PY_INSTALL_DRYRUN=1 prints the install commands and skips them.
setlocal
cd /d "%~dp0"
set "PY="
for %%V in (3.14 3.13 3.12 3) do (
if not defined PY (
py -%%V -c "import sys; sys.exit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>nul && set "PY=py -%%V"
)
)
if not defined PY (
where python >nul 2>nul && (
python -c "import sys; sys.exit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>nul && set "PY=python"
set "PY_EXE="
set "PY_ARG="
set "PY_NOTK="
call :find_python
if not defined PY_EXE call :find_user_python
if not defined PY_EXE call :offer_python
if not defined PY_EXE (
echo.
if defined PY_NOTK (
echo Python was found, but without Tcl/Tk, which the launcher's window needs.
echo Install Python 3.12 or newer from https://www.python.org/downloads/ with "tcl/tk and IDLE" ticked
echo ^(Customize installation^), or run its installer again and choose Modify to add it.
) else (
echo Python 3.12 or newer is needed: https://www.python.org/downloads/
echo Tick "Add python.exe to PATH" during setup.
)
)
if not defined PY (
echo Python 3.12 or newer is needed: https://www.python.org/downloads/
echo Tick "Add python.exe to PATH" during setup.
pause
if not defined LEONIDA_NO_PAUSE pause
exit /b 1
)
%PY% -I "%~dp0tools\leonida_launcher.py" %*
set "RC=%ERRORLEVEL%"
if not "%RC%"=="0" pause
exit /b %RC%
rem One line, read whole before the launcher runs: an update that replaces this file cannot change what follows,
rem the error path included (its code, git's or the build's with --update, goes back to the caller).
"%PY_EXE%" %PY_ARG% -I "%~dp0tools\leonida_launcher.py" %* && exit /b 0 || (call set "RC=%%errorlevel%%" & setlocal EnableDelayedExpansion & echo. & echo The launcher stopped with code !RC!. Read the message above. & (if not defined LEONIDA_NO_PAUSE pause) & exit /b !RC!)

rem ---- Helpers (only reached by "call"; the script exits above) ----


rem The py launcher's versions, newest first, then python on PATH: the first that is 3.12 or newer and has Tk.
:find_python
for %%V in (3.14 3.13 3.12 3) do call :try_py %%V
if defined PY_EXE exit /b 0
where python >nul 2>nul || exit /b 0
call :try_python python
exit /b 0

:try_py
if defined PY_EXE exit /b 0
py -%1 -c "import sys; sys.exit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>nul || exit /b 0
py -%1 -c "import tkinter; tkinter.Tcl()" >nul 2>nul || (set "PY_NOTK=1" & exit /b 0)
set "PY_EXE=py"
set "PY_ARG=-%1"
exit /b 0

rem Each per-user install under %LOCALAPPDATA%\Programs\Python (python.org or winget with "Add to PATH" unticked),
rem highest folder name first; each one is checked, so the name order does not matter.
:find_user_python
for /f "delims=" %%D in ('dir /b /ad /o-n "%LOCALAPPDATA%\Programs\Python\Python3*" 2^>nul') do call :try_python "%LOCALAPPDATA%\Programs\Python\%%D\python.exe"
exit /b 0

:try_python
if defined PY_EXE exit /b 0
if /i not "%~1"=="python" if not exist "%~1" exit /b 0
"%~1" -c "import sys; sys.exit(0 if sys.version_info >= (3, 12) else 1)" >nul 2>nul || exit /b 0
"%~1" -c "import tkinter; tkinter.Tcl()" >nul 2>nul || (set "PY_NOTK=1" & exit /b 0)
set "PY_EXE=%~1"
set "PY_ARG="
exit /b 0

rem Ask first, then install Python 3.12 (with Tcl/Tk) for this user only: winget if present, else the pinned
rem python.org installer checked against its SHA-256 (the same one Build.bat uses). On "No" or any failure PY_EXE
rem stays unset and the caller prints the manual instructions.
:offer_python
echo.
if defined PY_NOTK (
echo Python was found without Tcl/Tk, which the launcher's window needs.
) else (
echo Python 3.12 or newer was not found, and the launcher needs it.
)
choice /c YN /n /t 60 /d N /m "Download and install Python 3.12 with Tcl/Tk for your user account now? (No admin needed) [Y/N] "
if errorlevel 2 exit /b 0
if not errorlevel 1 exit /b 0
where winget >nul 2>nul && goto :py_winget
:py_download
set "PYURL=https://www.python.org/ftp/python/3.12.10/python-3.12.10-amd64.exe"
set "PYSHA=67B5635E80EA51072B87941312D00EC8927C4DB9BA18938F7AD2D27B328B95FB"
set "PYTMP=%TEMP%"
if not defined PYTMP set "PYTMP=%LOCALAPPDATA%\Temp"
if not defined PYTMP set "PYTMP=%~dp0"
set "PYEXE=%PYTMP%\leonida-python-3.12.10-amd64.exe"
if defined LEONIDA_PY_INSTALL_DRYRUN goto :py_dry_download
echo Downloading Python 3.12.10 from python.org ...
powershell -NoProfile -Command "$ErrorActionPreference='Stop'; $ProgressPreference='SilentlyContinue'; [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -UseBasicParsing -Uri $env:PYURL -OutFile $env:PYEXE; if ((Get-FileHash -Algorithm SHA256 -LiteralPath $env:PYEXE).Hash -ine $env:PYSHA) { Remove-Item -LiteralPath $env:PYEXE -Force; exit 3 }"
if errorlevel 1 goto :py_download_failed
echo Installing Python 3.12.10 ...
start "" /wait "%PYEXE%" /quiet InstallAllUsers=0 PrependPath=1 Include_launcher=1 Include_tcltk=1
del /q "%PYEXE%" >nul 2>nul
goto :py_installed

:py_download_failed
echo The download failed or did not match its checksum, so it was not run.
del /q "%PYEXE%" >nul 2>nul
exit /b 0

:py_dry_download
echo [dry run] would download %PYURL%
echo [dry run] would check SHA-256 %PYSHA%
echo [dry run] would run "%PYEXE%" /quiet InstallAllUsers=0 PrependPath=1 Include_launcher=1 Include_tcltk=1
exit /b 0

:py_winget
set "PYWG=winget install --id Python.Python.3.12 -e --scope user --silent --accept-package-agreements --accept-source-agreements"
if defined LEONIDA_PY_INSTALL_DRYRUN goto :py_dry_winget
echo Installing Python 3.12 with winget ...
call %PYWG%
call :find_user_python
if defined PY_EXE exit /b 0
echo winget did not install a Python with Tcl/Tk; trying the python.org installer instead.
goto :py_download

:py_dry_winget
echo [dry run] would run %PYWG%
goto :py_download

:py_installed
call :find_user_python
exit /b 0
Loading