Skip to content

Instantly share code, notes, and snippets.

@DylanPMunyard
Last active March 16, 2026 08:44
Show Gist options
  • Select an option

  • Save DylanPMunyard/aa791733d55d5deef10c158e306287c5 to your computer and use it in GitHub Desktop.

Select an option

Save DylanPMunyard/aa791733d55d5deef10c158e306287c5 to your computer and use it in GitHub Desktop.
1942 on Linux

Installation

  1. Download the game

  2. Install with Wine

    wine installer.exe

    Installs to: ~/.wine/drive_c/EA Games/Battlefield 1942/

  3. The installer ships with a bunch of community improvements called bf42plus. The way it works is to 'hook' the bf1942.exe process which is automatic on Windows, but with wine you need to manually configure it.

    • Run winecfg
    • Applications > Add application > Choose BF1942.exe from `C:\EA Games\Battlefield 1942\BF1942.exe'
    • Libraries > New override for library: dsound

    bf42plus ships itself as a DLL named dsound.dll

  4. Create launcher script

    Create launch.sh in the game directory.

    #!/bin/bash
    cd "~/.wine/drive_c/EA Games/Battlefield 1942"
    
    # Parse bf1942://IP:PORT URL if provided
    JOIN_ARGS=()
    if [[ "$1" == bf1942://* ]]; then
        hostport="${1#bf1942://}"
        hostport="${hostport%/}"
        IP="${hostport%%:*}"
        PORT="${hostport##*:}"
        if [[ -n "$IP" && -n "$PORT" ]]; then
            JOIN_ARGS=(+joinServer "$IP" +port "$PORT")
        fi
    fi
    
    wine "./BF1942.exe" +restart 1 +game.setGameDisplayMode 2560 1440 32 60 "${JOIN_ARGS[@]}"
    echo "Press Enter to close this window..."
    read

    Then: chmod +x launch.sh

    launch.sh Code explainer

    The JOIN_ARGS code is to parse optional arguments in the form bf1942://101.35.241.106:14567. This will join the server with the given IP and port.

  5. Create desktop file

    Create ~/.local/share/applications/battlefield-1942.desktop:

    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=Battlefield 1942
    Exec="~/.wine/drive_c/EA Games/Battlefield 1942/launch.sh" %u
    Icon=~/.wine/drive_c/EA Games/Battlefield 1942/bf1942.ico
    Categories=Game;
    Terminal=false
    MimeType=x-scheme-handler/bf1942;
  6. Register the bf1942:// URL scheme

    This lets you join servers directly from the browser via links like bf1942://51.81.48.224:14567 (e.g. from joinme.click):

    xdg-mime default battlefield-1942.desktop x-scheme-handler/bf1942

    Verify: xdg-mime query default x-scheme-handler/bf1942 should return battlefield-1942.desktop

    Test: xdg-open "bf1942://51.81.48.224:14567" should launch the game and connect to the server.

Optional - but probably a good idea

To run mods like FHSW and BF1918 that consume > 2GB of memory, you'll need the 4GB patch.

  1. Download it https://ntcore.com/4gb-patch/
  2. Run it wine 4gb_patch.exe and choose BF1942.exe to patch it

If you don't do this, the maps will typically load and then the game will crash.

Debugging

I have a Logitech Extreme 3d Pro that just worked. But it was not calibrated and would roll to the left badly.

  • I downloaded this https://github.com/dkosmari/calibrate-joystick (and built it following the instructions)
  • You run it, and basically use the X, Y and Z axes (left / right, forward / back, rudder left / rudder right)
  • At the same time click the trigger button
  • Then apply it
  • This fixes the issue.

Run wine control > Game Controllers if you want to debug issues where can't detect the joystick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment