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,11 +103,15 @@ public class UploadResource {
// Detect platform (DOS vs Windows) by reading the main EXE header
String platform = detectPlatform(Path.of(mainExe));
// Create setup bundle only if the game is a DOS executable
// (Windows setup bundles are useless — they need Windows to run)
if (setupExe != null && !"windows".equals(platform)) {
Path setupBundlePath = svc.getGamesDir().resolve(gameId + ".setup.jsdos");
createBundle(extractDir, setupExe, setupBundlePath);
// Create setup bundle only if the setup executable is itself DOS-compatible.
// Some games (e.g. Fallout) ship a Windows SETUP.EXE even though the main
// 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");
createBundle(extractDir, setupExe, setupBundlePath);
}
}
// Save metadata