diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index 8abacc3..1879986 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - rid: [linux-x64, win-x64] + rid: [linux-x64, win-x64, osx-arm64] steps: - name: Checkout Repository diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index f1492cc..19b8673 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -75,6 +75,9 @@ jobs: - name: win-x64 Build run: dotnet publish -p:PublishProfile=win-x64 -c Release -p:AssemblyVersion=${{ github.event.inputs.version }} -p:FileVersion=${{ github.event.inputs.version }} -o ./output/win-x64 ${{env.PROJECT_PATH}} + - name: osx-arm64 Build + run: dotnet publish -p:PublishProfile=osx-arm64 -c Release -p:AssemblyVersion=${{ github.event.inputs.version }} -p:FileVersion=${{ github.event.inputs.version }} -o ./output/osx-arm64 ${{env.PROJECT_PATH}} + - name: flatpak-x86_64 Build env: APP_VERSION: ${{ github.event.inputs.version }} @@ -87,6 +90,7 @@ jobs: run: | mkdir -p ./release mv ./output/win-x64/HedgeModManager.UI.exe ./release/HedgeModManager.exe + mv ./output/osx-arm64/HedgeModManager.UI ./release/HedgeModManager mv ./flatpak/${{env.FLATPAK_ID}}.flatpak ./release/${{env.FLATPAK_ID}}.flatpak - name: Create Release diff --git a/.gitignore b/.gitignore index f740d3a..460b688 100644 --- a/.gitignore +++ b/.gitignore @@ -215,3 +215,4 @@ _Pvt_Extensions/ ModelManifest.xml Ignored/ +.DS_Store diff --git a/Source/HedgeModManager.UI/Properties/PublishProfiles/osx-arm64.pubxml b/Source/HedgeModManager.UI/Properties/PublishProfiles/osx-arm64.pubxml new file mode 100644 index 0000000..f079ae4 --- /dev/null +++ b/Source/HedgeModManager.UI/Properties/PublishProfiles/osx-arm64.pubxml @@ -0,0 +1,7 @@ + + + osx-arm64 + true + false + + diff --git a/Source/Libraries/HedgeModManager.Epic/EpicLocator.cs b/Source/Libraries/HedgeModManager.Epic/EpicLocator.cs index 85fb224..32283f9 100644 --- a/Source/Libraries/HedgeModManager.Epic/EpicLocator.cs +++ b/Source/Libraries/HedgeModManager.Epic/EpicLocator.cs @@ -31,7 +31,12 @@ public void LocateEpicRoots() searchPaths.Add(Path.Combine(appdata, "heroic")); searchPaths.Add(Path.Combine("heroic")); } - + + if (OperatingSystem.IsMacOS()) + { + searchPaths.Add(Path.Combine(appdata, "heroic")); + } + if (OperatingSystem.IsLinux()) { // Heroic Games Launcher (Flatpak) diff --git a/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs b/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs index 5f310e7..72e8772 100644 --- a/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs +++ b/Source/Libraries/HedgeModManager.Steam/SteamLocator.cs @@ -32,6 +32,13 @@ public class SteamLocator : IGameLocator return null; } + [SupportedOSPlatform("macos")] + private string? FindSteamLibraryMacOS() + { + // TODO: Open a folder selection window + return ""; + } + private string? FindSteamLibraryUnix() { var pathList = new[] @@ -62,6 +69,12 @@ public class SteamLocator : IGameLocator return SteamInstallPath; } + if (OperatingSystem.IsMacOS()) + { + SteamInstallPath = FindSteamLibraryMacOS(); + return SteamInstallPath; + } + SteamInstallPath = FindSteamLibraryUnix(); return SteamInstallPath; } @@ -128,6 +141,22 @@ public List Locate() continue; } + // Paths will be encoded by Windows Steam and will need to be adapted for macOS paths. + // C:\ is equivalent to the Wine prefix. + // Any other drive letter should be removed and treated as raw Unix path. + if (OperatingSystem.IsMacOS()) + { + if (path.StartsWith(@"C:\")) + { + path = SteamInstallPath; + } + else + { + // Remove drive letter and replace slashes + path = path[2..].Replace(@"\", "/"); + } + } + var libPath = Path.Combine(path, "steamapps"); foreach (var app in apps) {