Check setup EXE's own platform before creating setup bundle
Build & Deploy / build-and-deploy (push) Successful in 40s

Previously only checked the main game's platform. Fallout's SETUP.EXE
is a Windows executable even though FALLOUT.EXE is DOS — creating a
.setup.jsdos bundle for it would show 'This program cannot run in DOS mode'.
Now detects the setup EXE's own header and skips if it targets Windows.
This commit is contained in:
Hermes Agent
2026-05-29 09:41:45 +02:00
parent 45d145a950
commit 473fb7a216
@@ -103,12 +103,16 @@ public class UploadResource {
// Detect platform (DOS vs Windows) by reading the main EXE header // Detect platform (DOS vs Windows) by reading the main EXE header
String platform = detectPlatform(Path.of(mainExe)); String platform = detectPlatform(Path.of(mainExe));
// Create setup bundle only if the game is a DOS executable // Create setup bundle only if the setup executable is itself DOS-compatible.
// (Windows setup bundles are useless — they need Windows to run) // Some games (e.g. Fallout) ship a Windows SETUP.EXE even though the main
if (setupExe != null && !"windows".equals(platform)) { // game is DOS — that setup would fail with "This program cannot run in DOS mode".
if (setupExe != null) {
String setupPlatform = detectPlatform(Path.of(setupExe));
if (!"windows".equals(setupPlatform)) {
Path setupBundlePath = svc.getGamesDir().resolve(gameId + ".setup.jsdos"); Path setupBundlePath = svc.getGamesDir().resolve(gameId + ".setup.jsdos");
createBundle(extractDir, setupExe, setupBundlePath); createBundle(extractDir, setupExe, setupBundlePath);
} }
}
// Save metadata // Save metadata
Game game = new Game(gameId, title); Game game = new Game(gameId, title);