diff --git a/ModTek.Common/Globals/Paths.cs b/ModTek.Common/Globals/Paths.cs index 6bea83ce..d4c0f2d9 100644 --- a/ModTek.Common/Globals/Paths.cs +++ b/ModTek.Common/Globals/Paths.cs @@ -7,10 +7,20 @@ internal static class Paths { // Common paths - // BATTLETECH/Mods/ModTek/lib/ModTek.Common.dll -> BATTLETECH + // Linux: + // BATTLETECH/Mods/ModTek/lib/ModTek.Common.dll + // BATTLETECH/BattleTech_Data/Managed + // Mac: + // BATTLETECH/BattleTech.app/Contents/Resources/Mods/ModTek/lib/ModTek.Common.dll + // BATTLETECH/BattleTech.app/Contents/Resources/Data/Managed + // run.sh on Mac should create a symlink from BattleTech_Data -> Data + // Windows: + // BATTLETECH\Mods\ModTek\lib\ModTek.Common.dll + // BATTLETECH\BattleTech_Data\Managed internal static readonly string BaseDirectory = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "..", "..", "..")); // Mac has Data, but we have a symlink from BattleTech_Data to Data anyway - internal static readonly string ManagedDirectory = Path.Combine(BaseDirectory, "BattleTech_Data", "Managed"); + internal static readonly string ManagedDirectory = Path.Combine(BaseDirectory, IsMac ? "Data" : "BattleTech_Data", "Managed"); + private static bool IsMac => File.Exists(Path.Combine(BaseDirectory, "Data", "Managed", "Assembly-CSharp.dll")); internal static readonly string ModsDirectory = Path.Combine(BaseDirectory, "Mods"); internal static readonly string ModTekDirectory = Path.Combine(ModsDirectory, "ModTek"); diff --git a/ModTek.Preloader/run.sh b/ModTek.Preloader/run.sh index bbf03724..90f60858 100755 --- a/ModTek.Preloader/run.sh +++ b/ModTek.Preloader/run.sh @@ -33,7 +33,7 @@ fi # get doorstop settings for linux/mac from the ini (why does doorstop not do this for us?) doorstop_config() { grep "^${1}=" "${BASEDIR}/doorstop_config.ini" | cut -d= -f2- ; } doorstop_convert_bool() { sed s@true@1@ | sed s@false@0@ ; } -doorstop_convert_path() { tr '\\' '/' ; } +doorstop_convert_path() { tr '\\' '/' | tr ';' ':' ; } export DOORSTOP_MONO_DEBUG_ENABLED="$(doorstop_config debug_enabled | doorstop_convert_bool)" export DOORSTOP_MONO_DEBUG_ADDRESS="$(doorstop_config debug_address)" export DOORSTOP_MONO_DEBUG_SUSPEND="$(doorstop_config debug_suspend | doorstop_convert_bool)"