diff --git a/src/main/java/com/dostalgia/UploadResource.java b/src/main/java/com/dostalgia/UploadResource.java index fe47fb1..158a155 100644 --- a/src/main/java/com/dostalgia/UploadResource.java +++ b/src/main/java/com/dostalgia/UploadResource.java @@ -245,6 +245,12 @@ public class UploadResource { if (!name.endsWith(".exe") && !name.endsWith(".com") && !name.endsWith(".bat")) return FileVisitResult.CONTINUE; + // Skip known extender / tool executables (DOS4GW, DEBUG, etc.) + int dot = name.lastIndexOf('.'); + String stem = dot >= 0 ? name.substring(0, dot) : name; + if (SKIP_EXE_NAMES.contains(stem)) + return FileVisitResult.CONTINUE; + boolean installer = name.contains("install") || name.contains("setup") || name.contains("config"); int depth = f.getNameCount() - dir.getNameCount(); candidates.add(new Candidate(depth, installer, a.size(), f.toString())); @@ -311,6 +317,21 @@ public class UploadResource { ".dmg" // Mac disk images ); + /** + * Executable filenames (lowercase, stem only, no extension) that should NEVER + * be selected as the main game executable. These are DOS extenders, DPMI hosts, + * debuggers, and other auxiliary tools that ship alongside many DOS games. + */ + private static final java.util.Set SKIP_EXE_NAMES = java.util.Set.of( + "dos4gw", "dos32a", "dos4gw2", // DOS/4GW family (DOS extenders) + "pmode", "pmodew", // Watcom / PMODE extenders + "cwsdpmi", // DPMI host (used by many DJGPP games) + "emm386", // Expanded memory manager + "himem", "himemx", // Extended memory managers + "debug", // Debugger + "uninst", "uninstall", "uninstaller" // Uninstallers + ); + private void createBundle(Path extractDir, String exePath, Path bundlePath) throws IOException { // Write .jsdos config directly into the extract directory Path jsdos = extractDir.resolve(".jsdos");