[GH-ISSUE #4394] [Other] START-HERE.bat: the & goto :eof escapes the if — the Python search stops after the first probe #1947

Closed
opened 2026-11-04 01:55:30 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4394

Problem: START-HERE.bat :findpy, lines 61-64. cmd parses if <cond> cmd1 & cmd2 as TWO commands: the & goto :eof sits OUTSIDE the if (the classic unparenthesized-& trap). So line 61 (if not errorlevel 1 set "PY=py -3" & goto :eof) returns from the subroutine after the py -3 probe REGARDLESS of whether it succeeded — and lines 62-63 (python on PATH) and line 64 (the per-user %LOCALAPPDATA%\Programs\Python\Python31x fallbacks) are dead code.

Environment:
Strata Version: 0.2.7 (source checkout at tag v0.2.7, commit 5e8a4cca; file byte-identical)
OS: Windows semantics (found in a Linux checkout; no cmd available here)
Consequence: a Windows PC whose Python is reachable as python but not via the py launcher (conda, embedded distro, custom installs) is told to install Python anyway; and after the script's OWN per-user install (the current cmd session never sees the updated PATH), the line-64 fallback written for exactly that moment never runs, so the script prints "Python could not be installed automatically... double-click START-HERE.bat again." A latent extra: line 64's own & goto :eof also lands outside the loop body — if reached, the loop would run all four exist-checks with the last match (the OLDEST installed version) winning.

Expected: if <cond> (cmd1 & cmd2) — or split lines — so each probe is actually tried in order.
Reproduction status: unconfirmed static analysis (documented cmd parsing rule; not executed here). What would verify: on a Windows box with python on PATH but no py launcher, run START-HERE.bat --check and watch it miss the found Python.

Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4394 Problem: START-HERE.bat :findpy, lines 61-64. cmd parses `if <cond> cmd1 & cmd2` as TWO commands: the `& goto :eof` sits OUTSIDE the if (the classic unparenthesized-& trap). So line 61 (`if not errorlevel 1 set "PY=py -3" & goto :eof`) returns from the subroutine after the `py -3` probe REGARDLESS of whether it succeeded — and lines 62-63 (python on PATH) and line 64 (the per-user %LOCALAPPDATA%\Programs\Python\Python31x fallbacks) are dead code. Environment: **Strata Version:** 0.2.7 (source checkout at tag v0.2.7, commit 5e8a4cca; file byte-identical) **OS:** Windows semantics (found in a Linux checkout; no cmd available here) Consequence: a Windows PC whose Python is reachable as `python` but not via the `py` launcher (conda, embedded distro, custom installs) is told to install Python anyway; and after the script's OWN per-user install (the current cmd session never sees the updated PATH), the line-64 fallback written for exactly that moment never runs, so the script prints "Python could not be installed automatically... double-click START-HERE.bat again." A latent extra: line 64's own `& goto :eof` also lands outside the loop body — if reached, the loop would run all four exist-checks with the last match (the OLDEST installed version) winning. Expected: `if <cond> (cmd1 & cmd2)` — or split lines — so each probe is actually tried in order. Reproduction status: unconfirmed static analysis (documented cmd parsing rule; not executed here). What would verify: on a Windows box with python on PATH but no py launcher, run START-HERE.bat --check and watch it miss the found Python.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660370916 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1947
No description provided.