Skip to content

Linux support #40

Open
Open

Description

@bertuss

Hi, I noticed the "Start porting to Linux" commits in September and wanted to check in before doing anything that might clash with your plans.

I play D2R on Linux (Battle.net under umu-launcher + GE-Proton) and would like to help get d2modgen working natively there, ideally as PRs to this repo. I've done some groundwork already:

  • CascLib works on Linux. The pinned submodule builds unchanged on Linux and opens a real D2R install inside a Wine/Proton prefix (product osi, build 93847), reading the excel tables offline with the same calls CascStorage.cpp used before the stubs. The main code changes are un-gating include(CascLib)/include(StormLib) in CMake and passing UTF-8 char* paths instead of .wstring() on non-Windows.
  • StormLib needs a small CMake fix on Linux: drop lzma/C/LzFindMt.c and Threads.c, and define _7ZIP_ST BZ_STRICT_ANSI (this matches StormLib's own CMake).
  • Paths on Linux come from a Wine prefix. The D2R install, Saved Games, and Battle.net.config all live inside the prefix (for example ~/Games/battlenet/drive_c/..., Windows user steamuser under Proton). They can be found by reading the prefix's system.reg/user.reg instead of the Windows registry.
  • The Extra tab maps over too: editing Battle.net.config works the same under Wine, and launching D2R.exe -mod <name> -txt directly through a runner such as umu-run appears to work without a Battle.net hand-off. Linux would get a .desktop file instead of a .lnk.

Questions before I go further:

  1. Are you actively working on Linux support, and is there anything in progress I should build on rather than duplicate?
  2. Would you accept PRs for this? If so, do you prefer one PR or a series (for example: build and CASC reading -> prefix-based path detection -> Extra-tab actions -> packaging)?
  3. Where should platform-specific code live? UIController.cpp free functions, a new module in CoreLib (so modgen_console benefits too), or mernel (for example createShortCut/AppLocations)?
  4. Any preference on Linux distribution (AppImage built in CI next to the Windows zip, or build-from-source only)?

Happy to adjust to whatever direction you have in mind. Thanks for the tool!

Activity

  1. mapron commented on Oct 4, 2026

    @mapron
    Owner

    I will gladly accept PR for proper fix for Linux. I just added Github CI actions to check Win/Linux builds, and support was preliminary as I don't have linux host right now (not a big deal but don't bother at the moment).

    You can place free functions on UIController, yes, why not.

    One suggestion: make build for core (casc/storm) a separate PR from UI thingies (like shortcuts).

    Yes, you can open MR for mernel for shortcut code. This method is utilized by FreeHeroes project, it will do no harm have extra implementation.

    No preference on distros. I mean, upstream library should be distro-agnostic. I would like to keep github actions with ubuntu-24.04 (or latest provided). That's it.

  2. mapron commented on Oct 4, 2026

    @mapron
    Owner

    "I play D2R on Linux" yet I had discussion with friend "surely there is dozen people who play D2R on linux and no chance they are interested in modgen" lmao...

  3. mapron commented on Oct 18, 2026

    @mapron
    Owner

    @bertuss so will you look on that or should I fix linux build myself? I will need to set VM to see what issues with storm/casc are...

  4. leduythuccs commented on Nov 10, 2026

    @leduythuccs
    Collaborator

    I'm looking into this issue. Getting the core to work (build succeeds) is relatively easy. The hard part is adapting the Extra tab to Linux, because it would need:

    • the wine prefix path
    • to create a .desktop file, it would need to know how you run the game -> this is the hardest part for me.
  5. leduythuccs commented on Nov 10, 2026

    @leduythuccs
    Collaborator

    The way I implemented the Extra tab is as follows:

    • The user inputs the Wine prefix, which is then used for all Extra actions.
    • Making a shortcut behaves just like Windows/Wine: it creates a .lnk file on the Wine prefix's desktop. The reason for not creating a .desktop file is that we don't have information about how the user is running the game.

    For me the lnk file is good enough, we could launch it through our running just fine

    I would love to discuss more before open a new PR for this!

    Image
  6. mapron commented on Nov 10, 2026

    @mapron
    Owner

    Yeah just make wine prefix permanent kkey in schema.yaml but widget in QML should be under linux condition.

    about wine shortcut - sounds good, you are more user that me to decide! Well I used Linux for ages but never played games with wine .

  7. leduythuccs commented on Nov 11, 2026

    @leduythuccs
    Collaborator

    #48 fixed most of extra tab, except the .lnk.

    I've just realized that create the lnk required windows API, so now we have 3 options:

    • implement .lnk, we need to implement the windows API (or some workarounds, haven't look deep into this)
    • implement .desktop, this will require user to input the runner command. Tho I'm not entirely sure this work for all runner.
    • Hide the option on linux

    What do you think?

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions