Run: a folder given as the executable is said so; README clones this repository (#395) #398

Open
github-bot wants to merge 1 commit from github-bot/gh-398 into a-publier AGit
Owner

@⁠hussainmussa on GitHub · 2026-11-26 23:47 UTC · original
hussainmussa:fix/exe-is-a-folder → a-publier · +9 −2 · 3 files · 1 commits · open

Fixes #395.

What was wrong

Two separate things in that report.

The error. victory run and scripts\play.ps1 take a folder for the title's executable and fail with

Error: reading C:\Games\...\<folder>

Caused by:
    Access is denied. (os error 5)

That is how Windows answers reading a folder as a file, and it reads as a permissions problem. play.ps1 only checked that the path exists, which a folder does, and run.rs went straight to std::fs::read.

The README. The clone command under "How to run it" named another fork (avatarmanz/VIctory-7900XTX), so someone following it builds that fork, not this one.

What this does

  • victory run: a folder is refused at once with <path> is a folder: give the path of the title's executable inside it.
  • scripts\play.ps1: the same check beside the existing "No ." one, so the launcher says it before anything starts.
  • README.md: the clone command and the cd after it name this repository.

Testing

Windows 11, Rust 1.98.1.

  • Before the change, victory run <a folder> gives exactly the reported text: reading <folder> / Access is denied. (os error 5).
  • After it: <folder> is a folder: give the path of the title's executable inside it.
  • scripts\play.ps1 -Exe <a folder>: prints the new line and exits 1. -Exe <a path that does not exist>: still No <path>., exit 1.
  • cargo clippy -p victory --no-deps --all-targets --locked -- -D warnings: clean.

Not tested: a run with a real executable (I have no game files). The check only refuses folders, so a file takes the same path as before.

I am assuming the reporter's path was a folder: it has no extension and the error matches to the letter, but only they can confirm it.

Written with help from Claude; everything above was built and run on my machine.

**@⁠hussainmussa** on GitHub · 2026-11-26 23:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/398) `hussainmussa:fix/exe-is-a-folder` → `a-publier` · +9 −2 · 3 files · 1 commits · open Fixes #395. ## What was wrong Two separate things in that report. **The error.** `victory run` and `scripts\play.ps1` take a folder for the title's executable and fail with ``` Error: reading C:\Games\...\<folder> Caused by: Access is denied. (os error 5) ``` That is how Windows answers reading a folder as a file, and it reads as a permissions problem. `play.ps1` only checked that the path exists, which a folder does, and `run.rs` went straight to `std::fs::read`. **The README.** The clone command under "How to run it" named another fork (`avatarmanz/VIctory-7900XTX`), so someone following it builds that fork, not this one. ## What this does - `victory run`: a folder is refused at once with `<path> is a folder: give the path of the title's executable inside it`. - `scripts\play.ps1`: the same check beside the existing "No <path>." one, so the launcher says it before anything starts. - `README.md`: the clone command and the `cd` after it name this repository. ## Testing Windows 11, Rust 1.98.1. - Before the change, `victory run <a folder>` gives exactly the reported text: `reading <folder>` / `Access is denied. (os error 5)`. - After it: `<folder> is a folder: give the path of the title's executable inside it`. - `scripts\play.ps1 -Exe <a folder>`: prints the new line and exits 1. `-Exe <a path that does not exist>`: still `No <path>.`, exit 1. - `cargo clippy -p victory --no-deps --all-targets --locked -- -D warnings`: clean. **Not tested:** a run with a real executable (I have no game files). The check only refuses folders, so a file takes the same path as before. I am assuming the reporter's path was a folder: it has no extension and the error matches to the letter, but only they can confirm it. Written with help from Claude; everything above was built and run on my machine.
victory run and scripts\play.ps1 took a folder for the title's
executable and failed with "reading <folder>: Access is denied (os
error 5)", which is how Windows answers reading a folder as a file.
Both now say that it is a folder and that the executable inside it is
wanted. The README's clone command named another fork.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:59:11 +00:00
Author
Owner

@⁠lvndrpup on GitHub · 2026-11-27 04:41 UTC · original · reviewed

Checked on Windows 11 build 26300, Rust 1.98.1, debug, with victory built at 4eb6cfd and at 2d59084. No game files, so the "file" cases use a small non-PE file. For play.ps1 I ran each version of the script against a stub victory.exe that prints its arguments and exits.

4eb6cfd this PR
victory run "<folder with a space>" (with and without --execute) Error: reading <folder> / Access is denied. (os error 5), exit 1 Error: <folder> is a folder: give the path of the title's executable inside it, exit 1
victory run <missing>.exe The system cannot find the file specified. (os error 2), exit 1 same
victory run <non-PE file> malformed image: Could not read file magic, exit 1 same
play.ps1 -Exe <folder> hands the folder to victory run --execute <folder> is a folder. Give the path of the executable inside it., exit 1, victory not started
play.ps1 -Exe <missing> No <path>., exit 1 same
cargo clippy -p victory --no-deps --all-targets -- -D warnings, with and without --all-features clean
cargo test -p xtask 9 passed

Overlaps, none of them blocking: #458 makes the same README clone fix (identical lines, so git merge of the two is clean), and #459 also edits scripts/play.ps1 a few lines lower (also merges clean with this one).

**@⁠lvndrpup** on GitHub · 2026-11-27 04:41 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/398#pullrequestreview-6083570960) · **reviewed** Checked on Windows 11 build 26300, Rust 1.98.1, debug, with `victory` built at `4eb6cfd` and at `2d59084`. No game files, so the "file" cases use a small non-PE file. For `play.ps1` I ran each version of the script against a stub `victory.exe` that prints its arguments and exits. | | `4eb6cfd` | this PR | |---|---|---| | `victory run "<folder with a space>"` (with and without `--execute`) | `Error: reading <folder>` / `Access is denied. (os error 5)`, exit 1 | `Error: <folder> is a folder: give the path of the title's executable inside it`, exit 1 | | `victory run <missing>.exe` | `The system cannot find the file specified. (os error 2)`, exit 1 | same | | `victory run <non-PE file>` | `malformed image: Could not read file magic`, exit 1 | same | | `play.ps1 -Exe <folder>` | hands the folder to `victory run --execute` | `<folder> is a folder. Give the path of the executable inside it.`, exit 1, `victory` not started | | `play.ps1 -Exe <missing>` | `No <path>.`, exit 1 | same | | `cargo clippy -p victory --no-deps --all-targets -- -D warnings`, with and without `--all-features` | | clean | | `cargo test -p xtask` | | 9 passed | Overlaps, none of them blocking: #458 makes the same README clone fix (identical lines, so `git merge` of the two is clean), and #459 also edits `scripts/play.ps1` a few lines lower (also merges clean with this one).
Author
Owner

@⁠gut0to on GitHub · 2026-11-27 15:16 UTC · original · reviewed

AI-assisted static review; I checked the PowerShell path validation added here. I did not run the script.

**@⁠gut0to** on GitHub · 2026-11-27 15:16 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/398#pullrequestreview-6090226902) · **reviewed** AI-assisted static review; I checked the PowerShell path validation added here. I did not run the script.
@ -34,6 +34,7 @@ foreach ($k in $More.Keys) { $settings[$k] = $More[$k] }
$victory = Join-Path $PSScriptRoot "..\target\$Build\victory.exe"
if (-not (Test-Path $victory)) { Write-Host "No $victory. Build it first (README.md)."; exit 1 }
if (-not (Test-Path $Exe)) { Write-Host "No $Exe."; exit 1 }
if (Test-Path $Exe -PathType Container) { Write-Host "$Exe is a folder. Give the path of the executable inside it."; exit 1 }
Author
Owner

@⁠gut0to on GitHub · 2026-11-27 15:16 UTC · original

AI-assisted review: $Exe is a user-supplied literal path, but Test-Path treats square brackets as wildcard syntax. A valid install path with a [Steam] directory can therefore make this new folder check inspect a pattern instead of the requested path. Could this use -LiteralPath (and update the existence check immediately above too) so the diagnostic works for bracketed paths?

**@⁠gut0to** on GitHub · 2026-11-27 15:16 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/398#discussion_r4721053184) AI-assisted review: `$Exe` is a user-supplied literal path, but `Test-Path` treats square brackets as wildcard syntax. A valid install path with a `[Steam]` directory can therefore make this new folder check inspect a pattern instead of the requested path. Could this use `-LiteralPath` (and update the existence check immediately above too) so the diagnostic works for bracketed paths?
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/398/head:github-bot/gh-398'
git switch 'github-bot/gh-398'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-398'
git switch 'github-bot/gh-398'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-398'
git switch 'github-bot/gh-398'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-398'
git switch 'a-publier'
git merge --squash 'github-bot/gh-398'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-398'
git switch 'a-publier'
git merge 'github-bot/gh-398'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.