« Back to home

A Stand-Alone Launcher For Baldur's Gate: Enhanced Edition (Ubuntu)

Posted on

In my last post, I described how to create a stand-alone launcher for Neverwinter Nights Enhanced Edition (henceforth NWNEE, because it’s a mouthful) on Linux. But if we’re talking old-school Bioware RPGs, I’m actually more of a Baldur’s Gate guy (I prefer the party-based gameplay and hand-drawn graphics). I’m currently finishing Baldur’s Gate: Siege of Dragonspear on Android and plan to replay the original campaign soon after for some 90s nostalgia (this one also has a recent Enhanced Edition). I’ll play mostly on my Androidphone, but sometimes I may yearn for the luxurious expanse of my GPD Pocket’s 8-inch screen ;-) So I bought BGEE for Linux too, and as expected it has the same problem as NWNEE - the binary is DRM-free, as advertised, but launches from the Beamdog Client application, which requires an internet connection to authenticate. As with NWN, we can make our own launcher to play offline1. I’ll skip the step-by-step detective work this time, but we follow the same approach as last time - ldd to identify the missing libraries,find to locate them, and LD_LIBRARY_PATH to tell the linker. It’s worth noting that BGEE misses not one but three dynamically linked libraries:

$ ldd BaldursGate
        linux-gate.so.1 =>  (0xf7f02000)
        libopenal.so.1 => not found // <-- Same as NWN:EE
        libGL.so.1 => /usr/lib/i386-linux-gnu/mesa/libGL.so.1 (0xf7e68000)
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7e4b000)
        librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf7e42000)
        libssl.so.1.0.0 => not found // <-- NEW
        libcrypto.so.1.0.0 => not found // <-- NEW
        libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xf7e17000)
        libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf7ccc000)
        libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7cc7000)
        libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7b50000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7afa000)
        libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7add000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7927000)
        libxcb-dri3.so.0 => /usr/lib/i386-linux-gnu/libxcb-dri3.so.0 (0xf7923000)
        libxcb-present.so.0 => /usr/lib/i386-linux-gnu/libxcb-present.so.0 (0xf791f000)
        libxcb-sync.so.1 => /usr/lib/i386-linux-gnu/libxcb-sync.so.1 (0xf7916000)
        libxshmfence.so.1 => /usr/lib/i386-linux-gnu/libxshmfence.so.1 (0xf7913000)
        libglapi.so.0 => /usr/lib/i386-linux-gnu/libglapi.so.0 (0xf78f5000)
        libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf78e0000)
        libXdamage.so.1 => /usr/lib/i386-linux-gnu/libXdamage.so.1 (0xf78dc000)
        libXfixes.so.3 => /usr/lib/i386-linux-gnu/libXfixes.so.3 (0xf78d4000)
        libX11-xcb.so.1 => /usr/lib/i386-linux-gnu/libX11-xcb.so.1 (0xf78d1000)
        libxcb-glx.so.0 => /usr/lib/i386-linux-gnu/libxcb-glx.so.0 (0xf78b6000)
        libxcb-dri2.so.0 => /usr/lib/i386-linux-gnu/libxcb-dri2.so.0 (0xf78b0000)
        libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf788a000)
        libXxf86vm.so.1 => /usr/lib/i386-linux-gnu/libXxf86vm.so.1 (0xf7882000)
        libdrm.so.2 => /usr/lib/i386-linux-gnu/libdrm.so.2 (0xf786e000)
        /lib/ld-linux.so.2 (0xf7f04000)
        libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf786a000)
        libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf7863000)

All come packaged with the Beamdog Client, but in two separate directories. Like PATH, LD_LIBRARY_PATH supports colon-separated values, so this is no problem.

We end up with the following shell script wrapper for launching the game:

(cd ~/Beamdog\ Library/00764/ && LD_LIBRARY_PATH='/home/m/.config/Beamdog Client/steam-runtime-release_2014-04-15/i386/lib/i386-linux-gnu/:/home/m/.config/Beamdog Client/steam-runtime-release_2014-04-15/i386/usr/lib/i386-linux-gnu/' ./BaldursGate)

And this .desktop entry to give us a nice clickable icon:

[Desktop Entry]
Name=Baldur's Gate
Icon=/home/m/Beamdog Library/00764/bg-icon.png

Just replace /home/m with your home directory and change the Beamdog directory if yours is not in the standard location. Then chmod +x both files, and voila, you have a stand-alone launcher for Baldur’s Gate Enhanced Edition.I currently don’t own other Beamdog titles for Linux, but if you do, the process for making a launcher should be similar (assuming those game binaries do not implement DRM beyond the Client authentication we have seen).

Happy DRM-free offline adventuring :-)

BG:EE Start Screen

  1. And frankly, to make it more convenient to launch the game - who wants to open one program just to launch another? ↩︎