Check setup EXE's own platform before creating setup bundle
Build & Deploy / build-and-deploy (push) Successful in 40s
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:
@@ -103,12 +103,16 @@ 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)) {
|
||||
// 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
|
||||
Game game = new Game(gameId, title);
|
||||
|
||||
Reference in New Issue
Block a user