fix hatari exists

This commit is contained in:
2026-08-10 21:28:01 +02:00
parent ea66414496
commit d06ee381be
5 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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.
+1 -3
View File
@@ -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;
+2 -2
View File
@@ -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`).
Regular → Executable
View File