macOS (Steam): ModTek.Preloader.dll not found since run.sh stopped prefixing DOORSTOP_TARGET_ASSEMBLY (v4.5.2)

オープン 初心者向け
#256 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
79/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp, shell
領域
devtools

調査の方向性

run.sh の Darwin 分岐、特に DOORSTOP_TARGET_ASSEMBLY と DOORSTOP_MONO_DLL_SEARCH_PATH_OVERRIDE に対する additional_path の処理を読む。ドキュメントに記載された macOS のセットアップに従って Steam の起動を再現し、Doorstop が解決したアセンブリパスを調べる。preloader が Contents/Resources/Mods/ModTek/lib/ から開き、ゲームに /W MODTEK と表示されれば完了。issue には GOG 向けに評価する提案の1行修正も記載されている。

索引モデルが issue の本文から書いたものです。

説明

Title: macOS (Steam): ModTek.Preloader.dll not found since run.sh stopped prefixing DOORSTOP_TARGET_ASSEMBLY (v4.5.2)

Summary

On macOS with the Steam build of BATTLETECH, ModTek v4.5.2 does not load. Doorstop injects fine, but DOORSTOP_TARGET_ASSEMBLY resolves against the install root instead of Contents/Resources, so ModTek.Preloader.dll is never opened. Commit 195e9e7 ("fix DOORSTOP_TARGET_ASSEMBLY in run.sh", PR #254) removed the $additional_path prefix that this launch path needs. Restoring that one line fixes it for me.

Environment

  • macOS 27.2.1 (build 26B131), Apple Silicon, game runs under Rosetta (x86_64 binary)
  • BATTLETECH from Steam, installed at <install>
  • ModTek v4.5.2 (tag v4.5.2 and latest point at the same commit, 1ba99b0)
  • run.sh SHA-256: 80b280769fa20405a214f59bfbe275cfce9a1d4744660e9b8f72f02900268494
  • ModTek files copied into BattleTech.app/Contents/Resources, chmod +x run.sh, Steam launch option generated with the documented echo command, code signature removed from Contents/MacOS/BattleTech

Steps to reproduce

  1. Install ModTek per INSTALL.md (macOS, Steam) with the files in Contents/Resources.
  2. Launch from Steam.
  3. The main menu shows no /W MODTEK suffix.

What I see

run.sh logs pwd as the install root (<install>, not Resources). Using the verbose Doorstop library from the zip (doorstop/verbose/libdoorstop.dylib), launched from Terminal with SteamAppId=637090:

[Doorstop] DOORSTOP_TARGET_ASSEMBLY: <install>/Mods/ModTek/lib/ModTek.Preloader.dll
[Doorstop] DOORSTOP_MONO_DLL_SEARCH_PATH_OVERRIDE: BattleTech.app/Contents/Resources/Mods/ModTek/lib/
[Doorstop] Mono search path: <install>/BattleTech.app/Contents/Resources/Mods/ModTek/lib:...
[Doorstop] Opening assembly: <install>/Mods/ModTek/lib/ModTek.Preloader.dll
[Doorstop] Failed to open assembly: <install>/Mods/ModTek/lib/ModTek.Preloader.dll

The search path override is correct because run.sh prefixes it with BattleTech.app/Contents/Resources/. The target assembly is not prefixed, so it points to a folder that doesn't exist (Mods lives under Resources).

Cause

Commit 195e9e7 removed this line from the Darwin branch:

DOORSTOP_TARGET_ASSEMBLY="$additional_path/$DOORSTOP_TARGET_ASSEMBLY"

Its description says the prefix stopped Doorstop from finding the assembly on a GOG launch (Apple M5 Pro, Tahoe 26.5.2). I suspect the working directory differs between the GOG and Steam launch paths, though I haven't verified how GOG starts the game. With the line removed, DOORSTOP_MONO_DLL_SEARCH_PATH_OVERRIDE still gets the prefix but the target assembly does not, so the two are resolved against the same working directory inconsistently.

Proposed fix

Minimal, tested: restore the removed line right after the additional_path= line in the Darwin branch. With it, the log shows the preloader opening from .../Contents/Resources/Mods/ModTek/lib/ and ModTek loads. [Confirm: Steam launch shows /W MODTEK.]

More robust, untested: make both paths independent of the working directory by resolving them from $BASEDIR:

DOORSTOP_TARGET_ASSEMBLY="$BASEDIR/$DOORSTOP_TARGET_ASSEMBLY"

That might work for both launchers, but I haven't tried it, and I haven't tried it with the search-path override.

Related documentation problems (macOS)

  • INSTALL.md says to run codesign --remove-signature Battletech in Resources. The executable is in Contents/MacOS, so the command fails with "No such file or directory" in Resources.
  • The step is needed with the current stock binary: it has hardened runtime (flags=0x10000(runtime), Developer ID, Paradox). lsof showed libdoorstop.dylib not mapped with the signature in place, and mapped after removal.
  • Steam's "Verify integrity of game files" restores the signature, so the step has to be repeated after verifying or updating.
主要言語
C#
スター
139
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

BattletechModders/ModTek のほかの issue

BattletechModders/ModTek の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。