Repository navigation
Windows .exe installer with install folder choice; open .wad files given without -iwad - #1
Conversation
…ven without -iwad - jpackage builds an .exe on Windows: install folder dialog (default C:\Program Files\DoomJava), Start menu and desktop shortcuts, .wad file association, fixed upgrade UUID. Per-OS jpackage options moved to doom-app/src/dist/jpackage/*.args. - The Windows portable zip ships the jpackage app-image (DoomJava.exe) instead of doom-java.bat. - LooseFiles: arguments before the first parameter are used by type (IWAD header -> -iwad, .wad -> -merge, .deh/.bex -> -deh, .lmp -> -playdemo), so file associations and dropping a file on the launcher work (D-173). - release.yml: WiX install step on Windows, workflow_dispatch and dist-test/* branches build without a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Devin Review found 3 potential issues.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| if (iwad == null && isIwad(arg)) { | ||
| iwad = arg; | ||
| } else { | ||
| merge.add(arg); |
There was a problem hiding this comment.
🔴 Bare IWAD name loads wrong game
When freedoom2.wad lives in an IWAD search directory, isIwad checks only the working directory and classifies it as a PWAD. The game loads its default IWAD and merges Freedoom instead of playing Freedoom 2.
Learn more
A bare filename can be resolved through the normal IWAD search path even when it is not in the working directory. isIwad only reads the raw path, while findWadByName searches the configured IWAD locations. When the raw path cannot be read, expansion turns it into -merge, and GameSources.load selects the default IWAD before merging the requested one. The resulting game uses data from two IWADs instead of the chosen game.
Example: Put freedoom2.wad in the portable iwads folder and run doom-java.sh freedoom2.wad from another directory. Expansion emits -merge freedoom2.wad; the game selects bundled doom1.wad before loading Freedoom 2.
Recommended fix: Resolve loose WAD names through the same IWAD search path before inspecting their headers, or defer classification until the locator can resolve them. Preserve the resolved path and treat an unreadable file as an error rather than assuming it is a PWAD.
Was this helpful? React with 👍 or 👎 to provide feedback.
| if (iwad == null && isIwad(arg)) { | ||
| iwad = arg; | ||
| } else { | ||
| merge.add(arg); |
There was a problem hiding this comment.
🔴 Explicit IWAD mixes two games
With a loose IWAD and explicit -iwad, LooseFiles merges the loose IWAD despite choosing the explicit one. Its maps and assets override the selected game's data.
Learn more
LooseFiles.expand appends the implicit -iwad after the explicit arguments. LaunchOptions.parse therefore selects the explicit IWAD. However, expansion has already placed the loose IWAD into the merge list when another IWAD was explicitly selected. GameSources.load merges it over the selected IWAD, letting its lumps replace the selected game's data.
Example: Run DoomJava.exe C:\wads\doom1.wad -iwad C:\wads\doom2.wad. Doom 2 becomes the base IWAD, but Doom 1 is merged on top instead of ignored.
Recommended fix: Before grouping WADs, detect an explicit -iwad. Do not merge a loose IWAD that lost to the explicit selection; apply this rule to every extra IWAD rather than treating it as a PWAD.
Was this helpful? React with 👍 or 👎 to provide feedback.
| String arg = args.get(i); | ||
| String lower = arg.toLowerCase(Locale.ROOT); | ||
| if (lower.endsWith(".wad")) { | ||
| // DIVERGE: Chocolate picks the IWAD by file name, and only for absolute Windows paths (docs/divergences.md) |
There was a problem hiding this comment.
🟡 Loose-file divergence lacks required ID
The DIVERGE comment omits D-173, violating the required divergence-reference format in coding rules.
| // DIVERGE: Chocolate picks the IWAD by file name, and only for absolute Windows paths (docs/divergences.md) | |
| // DIVERGE: Chocolate picks the IWAD by name and requires absolute Windows paths (see docs/divergences.md D-173) |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
.exe(jpackage + WiX): the user chooses the install folder (defaultC:\Program Files\DoomJava), Start menu and desktop shortcuts,.wadfile association, fixed upgrade UUID. Per-OS jpackage options moved todoom-app/src/dist/jpackage/*.args.DoomJava.exe) instead ofdoom-java.bat.LooseFiles): arguments before the first parameter are used by type (IWAD header →-iwad,.wad→-merge,.deh/.bex→-deh,.lmp→-playdemo); explicit parameters still win. This is what makes the file association and dropping a.wadon the launcher work on every version (divergence D-173).workflow_dispatchanddist-test/**branches build the artifacts (version 1.0.0) without publishing a release.Test plan
./mvnw verify-Pdistbuild on macOS (dmg + portable zips); headless timedemo: loosefreedoom2.wadloads Freedoom 2, explicit-iwadwinsdist-test/windows-exe: all 4 platforms green (run 39338225551).wadopens it, portableDoomJava.exeaccepts a dropped.wad🤖 Generated with Claude Code