From d06ee381beb9d150411e559173efc4ade542da71 Mon Sep 17 00:00:00 2001 From: Stefan Koelle Date: Mon, 10 Aug 2026 21:28:01 +0200 Subject: [PATCH] fix hatari exists --- .github/workflows/release.yml | 2 +- AGENTS.md | 2 +- MarcerGameDvdLauncher/HatariLauncher.cs | 4 +--- README.md | 4 ++-- build.sh | 0 5 files changed, 5 insertions(+), 7 deletions(-) mode change 100644 => 100755 build.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db04117..0cc1bd6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,7 @@ jobs: if: matrix.os != 'windows-latest' run: | cd MarcerGameDvdLauncher/bin/Release/net10.0/${{ matrix.rid }}/publish - zip -r ../../../MarcerGameDvdLauncher-v${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}.zip . + zip -r $GITHUB_WORKSPACE/MarcerGameDvdLauncher-v${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}$ - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/AGENTS.md b/AGENTS.md index 85b9ca0..d3f5fca 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -75,7 +75,7 @@ The console launcher is meant for browsing a games directory and can launch ZIP - Empty directories must be displayed correctly (or reported correctly). - In the root directory, Backspace must have no effect (no error, do not leave the program). - Navigation (Backspace, Enter, etc.) must remain robust even for very deep or large directory trees. - - Hatari.Executable is validated during startup: the path is resolved (relative to the EXE directory when applicable) and must point to an existing .exe file. If validation fails the program must present a clear error and exit. + - Hatari.Executable is validated during startup: the path is resolved (relative to the EXE directory when applicable) and must point to an existing file. If validation fails the program must present a clear error and exit. ### Miscellaneous - Optional: Build and start scripts (build.cmd / build.sh / start.cmd) are present, adapt as needed. diff --git a/MarcerGameDvdLauncher/HatariLauncher.cs b/MarcerGameDvdLauncher/HatariLauncher.cs index 116a33f..45f8b4e 100644 --- a/MarcerGameDvdLauncher/HatariLauncher.cs +++ b/MarcerGameDvdLauncher/HatariLauncher.cs @@ -11,11 +11,9 @@ namespace MarcerGameDvdLauncher if (string.IsNullOrWhiteSpace(exePath)) throw new ArgumentNullException(nameof(exePath)); - // Defensive validation: ensure the executable exists and looks like an .exe + // Defensive validation: ensure the executable exists if (!File.Exists(exePath)) throw new ArgumentException($"Hatari executable not found: {exePath}", nameof(exePath)); - if (!string.Equals(Path.GetExtension(exePath), ".exe", StringComparison.OrdinalIgnoreCase)) - throw new ArgumentException($"Hatari executable must be an .exe file: {exePath}", nameof(exePath)); _exePath = exePath; _cfgPath = cfgPath; diff --git a/README.md b/README.md index 7c27732..9743d9c 100644 --- a/README.md +++ b/README.md @@ -113,13 +113,13 @@ Example `launcher.config.example.json`: Fields: - RootDirectory: Absolute (or relative) path to the game root. Navigation must never leave this root directory. - PatchDirectory: Optional overlay/patch directory (merged with the main root at runtime). -- Hatari.Executable: Full path to `hatari.exe`. +- Hatari.Executable: Full path to the Hatari executable. - Hatari.ConfigFile: Full path to the Hatari configuration file. - Hatari.ArgsTemplate: Argument template used to start Hatari. Use `{cfg}` for the Hatari config file path and `{zip}` for the ZIP file to launch. Notes: - Relative paths are resolved relative to the EXE directory (AppContext.BaseDirectory). This makes behavior consistent when running from the build output folder. - - Hatari.Executable is validated at startup: the file must exist and have an .exe extension. Relative paths for Hatari settings are resolved against the EXE folder. + - Hatari.Executable is validated at startup: the file must exist. Relative paths for Hatari settings are resolved against the EXE folder. - `Hatari.ArgsTemplate` must contain at least the `{zip}` placeholder. Example: `-c "{cfg}" --disk-a "{zip}"`. - The program performs a straight string substitution of `{cfg}` and `{zip}`; it does not add additional quoting logic. Therefore include quotes around placeholders in the template if your paths contain spaces (as in the example). - `launcher.config.example.json` is copied to the output directory by the csproj (`CopyToOutputDirectory=PreserveNewest`). diff --git a/build.sh b/build.sh old mode 100644 new mode 100755