-
Notifications
You must be signed in to change notification settings - Fork 11
Macos support #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Macos support #28
Changes from 12 commits
67b59ce
8c956b4
6f941d9
409d8a0
70d5b0b
6aee6fe
2a4b84f
db07d96
e0ed516
f1e7c13
b8b3adb
a2ae2a1
73e5474
2993c29
e758958
1d2f7ea
9fab194
e4bc8ad
8459403
466a041
b88eacd
f11c76a
56f7431
b6b158e
9bb00f0
37f9d2d
bc7f08a
dbe4881
a3b7422
1b08a77
0a3be97
25decd2
964a1d7
c456b48
32b4237
83ace70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,11 +6,11 @@ on: | |
| version: | ||
| description: 'Version' | ||
| required: true | ||
| default: '8.0.0.2' | ||
| default: '8.0.0.3' | ||
| tag: | ||
| description: 'Tag' | ||
| required: true | ||
| default: '8.0.0-beta2' | ||
| default: '8.0.0-beta3' | ||
| prerelease: | ||
| description: 'Prerelease' | ||
| required: true | ||
|
|
@@ -19,6 +19,8 @@ on: | |
| env: | ||
| PROJECT_PATH: ./Source/HedgeModManager.UI/HedgeModManager.UI.csproj | ||
| FLATPAK_ID: io.github.hedge_dev.hedgemodmanager | ||
| MACOS_ID: com.hedge_dev.hedgemodmanager | ||
thesupersonic16 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| MACOS_BUILD_SCRIPT: ./macos/generate-bundle.bash | ||
thesupersonic16 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| GENERATOR_URL: https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/refs/heads/master/dotnet/flatpak-dotnet-generator.py | ||
| DOTNET_VERSION: 8 | ||
| DOTNET_CLI_HOME: /tmp/.dotnet | ||
|
|
@@ -82,12 +84,19 @@ jobs: | |
|
|
||
| - name: Build Flatpak Bundle | ||
| run: flatpak build-bundle repo ./flatpak/${{env.FLATPAK_ID}}.flatpak ${{env.FLATPAK_ID}} | ||
|
|
||
| - 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}} -p:UseAppHost=true | ||
|
|
||
| - name: Build osx-arm64 Bundle | ||
| run: /bin/bash ${{env.MACOS_BUILD_SCRIPT}} ${{ github.event.inputs.version }} ${{ env.MACOS_ID }} | ||
|
|
||
| - name: Prepare Release | ||
| run: | | ||
| mkdir -p ./release | ||
| mv ./output/win-x64/HedgeModManager.UI.exe ./release/HedgeModManager.exe | ||
| mv ./flatpak/${{env.FLATPAK_ID}}.flatpak ./release/${{env.FLATPAK_ID}}.flatpak | ||
| mv ./output/osx-arm64/HedgeModManager.app ./release/HedgeModManager.app | ||
|
||
|
|
||
| - name: Create Release | ||
| uses: softprops/[email protected] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,3 +215,4 @@ _Pvt_Extensions/ | |
| ModelManifest.xml | ||
|
|
||
| Ignored/ | ||
| .DS_Store | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,4 +12,4 @@ | |
| <ProjectReference Include="..\HedgeModManager\HedgeModManager.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| </Project> | ||
thesupersonic16 marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <Project> | ||
| <PropertyGroup> | ||
| <RuntimeIdentifiers>osx-arm64</RuntimeIdentifiers> | ||
| <PublishSingleFile>true</PublishSingleFile> | ||
| <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> | ||
| <SelfContained>true</SelfContained> | ||
| </PropertyGroup> | ||
| </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <Project> | ||
| <PropertyGroup> | ||
| <RuntimeIdentifiers>osx-x64</RuntimeIdentifiers> | ||
| <PublishSingleFile>true</PublishSingleFile> | ||
| <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> | ||
| <SelfContained>false</SelfContained> | ||
| </PropertyGroup> | ||
| </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,7 @@ public partial class MainWindowViewModel : ViewModelBase | |
| [ObservableProperty] private string _lastLog = ""; | ||
| [ObservableProperty] private string _message = ""; | ||
| [ObservableProperty] private TabInfo? _currentTabInfo; | ||
| [ObservableProperty] private TabInfo[] _tabInfos = | ||
| [ObservableProperty] private TabInfo[] _tabInfos = | ||
| [new ("Loading"), new("Setup"), new("Mods"), new("Codes"), new("Settings"), new("About"), new("Test")]; | ||
| [ObservableProperty] private ObservableCollection<Modal> _modals = []; | ||
| [ObservableProperty] private ObservableCollection<IMod> _mods = []; | ||
|
|
@@ -82,6 +82,7 @@ public MainWindowViewModel(UILogger logger, List<LanguageEntry> languages) | |
| Logger.Information($"Startup Date: {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} (UTC)"); | ||
| Logger.Debug($"IsWindows: {OperatingSystem.IsWindows()}"); | ||
| Logger.Debug($"IsLinux: {OperatingSystem.IsLinux()}"); | ||
| Logger.Debug($"IsMacos: {OperatingSystem.IsMacOS()}"); | ||
| Logger.Debug($"RID: {RuntimeInformation.RuntimeIdentifier}"); | ||
| Logger.Debug($"FlatpakID: \"{Program.FlatpakID}\" ({!string.IsNullOrEmpty(Program.FlatpakID)})"); | ||
| Logger.Debug($"InstallLocation: {Program.InstallLocation}"); | ||
|
|
@@ -109,7 +110,7 @@ public async Task CheckForManagerUpdatesAsync() | |
| .OnRun(async (d, c) => | ||
| { | ||
| d.CreateProgress().ReportMax(-1); | ||
|
|
||
| var (update, status) = await Updater.CheckForUpdates(); | ||
| if (update == null) | ||
| { | ||
|
|
@@ -337,7 +338,7 @@ await CreateSimpleDownload("Download.Text.InstallModLoader", "Failed to install | |
| var gameGeneric = GetModdableGameGeneric(); | ||
| if (gameGeneric == null || gameGeneric.ModLoader == null) | ||
| return; | ||
|
|
||
| if (install == true) | ||
| _ = await gameGeneric.ModLoader.InstallAsync(); | ||
| else | ||
|
|
@@ -385,7 +386,7 @@ public async Task SwitchProfileAsync() | |
|
|
||
| IsBusy = true; | ||
|
|
||
| await CreateSimpleDownload("Download.Text.SwitchProfileSave", "Failed to switch profiles", | ||
| await CreateSimpleDownload("Download.Text.SwitchProfileSave", "Failed to switch profiles", | ||
| async (d, p, c) => | ||
| { | ||
| var backupProgress = d.CreateProgress(); | ||
|
|
@@ -453,7 +454,18 @@ public async Task SaveAsync(bool setBusy = true) | |
|
|
||
| await SelectedGame.Game.ModDatabase.Save(); | ||
| if (SelectedGame.Game.ModLoaderConfiguration is ModLoaderConfiguration config) | ||
| await config.Save(Path.Combine(SelectedGame.Game.Root, "cpkredir.ini")); | ||
| { | ||
| // For macos, save under the user's Application Support directory. | ||
|
||
| if (OperatingSystem.IsMacOS()) | ||
| { | ||
| var appSupportDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); | ||
| await config.Save(Path.Combine( appSupportDir,SelectedGame.Game.Executable, "cpkredir.ini")); | ||
|
||
| } | ||
| else | ||
| { | ||
| await config.Save(Path.Combine(SelectedGame.Game.Root, "cpkredir.ini")); | ||
| } | ||
| } | ||
|
||
| } | ||
| catch (UnauthorizedAccessException e) | ||
| { | ||
|
|
@@ -889,7 +901,7 @@ public async Task StartServerAsync() | |
| ServerStatus = 1; | ||
| while (ServerStatus == 1) | ||
| { | ||
| using var server = new NamedPipeServerStream(Program.PipeName, PipeDirection.In, | ||
| using var server = new NamedPipeServerStream(Program.PipeName, PipeDirection.In, | ||
| NamedPipeServerStream.MaxAllowedServerInstances, | ||
| PipeTransmissionMode.Byte, PipeOptions.Asynchronous); | ||
| Logger.Debug("Waiting for connection"); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,15 @@ | |
|
|
||
| namespace HedgeModManager; | ||
|
|
||
| public class GameSimple(string platform, string id, string name, string root, string? executable, string nativeOS, string launchCommand, string launchCommandArgs) : IGame | ||
| public class GameSimple( | ||
| string platform, | ||
| string id, | ||
| string name, | ||
| string root, | ||
| string? executable, | ||
| string nativeOS, | ||
| string launchCommand, | ||
| string launchCommandArgs) : IGame | ||
| { | ||
| public string Platform { get; set; } = platform; | ||
| public string ID { get; set; } = id; | ||
|
|
@@ -20,15 +28,29 @@ public class GameSimple(string platform, string id, string name, string root, st | |
| public Task Run(string? launchArgs, bool useLauncher) | ||
| { | ||
| launchArgs ??= LaunchCommandArgs; | ||
|
|
||
| Process.Start(new ProcessStartInfo | ||
| if (OperatingSystem.IsMacOS()) | ||
| { | ||
| FileName = LaunchCommand, | ||
| Arguments = launchArgs ?? string.Empty, | ||
| WorkingDirectory = Root, | ||
| UseShellExecute = true | ||
| }); | ||
| // The command to launch macos apps is | ||
|
||
| // open -a path/to/my/app/appname | ||
| // When the app is inside the Application folder only the app's name is needed. | ||
|
||
| Process.Start(new ProcessStartInfo | ||
| { | ||
| FileName = "open", | ||
| Arguments = $"-a {Executable}", | ||
| UseShellExecute = false | ||
| }); | ||
| } | ||
| else | ||
| { | ||
| Process.Start(new ProcessStartInfo | ||
| { | ||
| FileName = LaunchCommand, | ||
| Arguments = launchArgs ?? string.Empty, | ||
| WorkingDirectory = Root, | ||
| UseShellExecute = true | ||
| }); | ||
| } | ||
|
|
||
| return Task.CompletedTask; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||||||||||||||||||||||||||||||||||||||
| namespace HedgeModManager; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| using Foundation; | ||||||||||||||||||||||||||||||||||||||||||
| using HedgeModManager.Epic; | ||||||||||||||||||||||||||||||||||||||||||
| using HedgeModManager.Properties; | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -16,30 +17,30 @@ public class ModdableGameLocator | |||||||||||||||||||||||||||||||||||||||||
| ID = "SonicGenerations", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderName = "HE1ModLoader", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderFileName = "d3d9.dll", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderIncompatibleFileNames = [ "dinput8.dll" ], | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderIncompatibleFileNames = ["dinput8.dll"], | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderDownloadURL = Resources.HE1MLDownloadURL, | ||||||||||||||||||||||||||||||||||||||||||
| Is64Bit = false, | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() | ||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| { "Steam", new ("71340", "SonicGenerations.exe") } | ||||||||||||||||||||||||||||||||||||||||||
| { "Steam", new("71340", "SonicGenerations.exe") } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||
| new() | ||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| ID = "SonicLostWorld", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderName = "HE1ModLoader", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderFileName = "d3d9.dll", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderIncompatibleFileNames = [ "dinput8.dll" ], | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderIncompatibleFileNames = ["dinput8.dll"], | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderDownloadURL = Resources.HE1MLDownloadURL, | ||||||||||||||||||||||||||||||||||||||||||
| Is64Bit = false, | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() { { "Steam", new ("329440", "slw.exe") } } | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() { { "Steam", new("329440", "slw.exe") } } | ||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||
| new() | ||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| ID = "SonicForces", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderName = "HE2ModLoader", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderFileName = "d3d11.dll", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderIncompatibleFileNames = [ "dinput8.dll" ], | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderIncompatibleFileNames = ["dinput8.dll"], | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderDownloadURL = Resources.HE2MLDownloadURL, | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() { { "Steam", new ("637100", Path.Combine("build", "main", "projects", "exec", "Sonic Forces.exe")) } } | ||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -49,15 +50,15 @@ public class ModdableGameLocator | |||||||||||||||||||||||||||||||||||||||||
| ModLoaderName = "HE2ModLoader", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderFileName = "dinput8.dll", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderDownloadURL = Resources.HE2MLDownloadURL, | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() { { "Steam", new ("1259790", "PuyoPuyoTetris2.exe") } } | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() { { "Steam", new("1259790", "PuyoPuyoTetris2.exe") } } | ||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||
| new() | ||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| ID = "Tokyo2020", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderName = "HE2ModLoader", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderFileName = "dinput8.dll", | ||||||||||||||||||||||||||||||||||||||||||
| ModLoaderDownloadURL = Resources.HE2MLDownloadURL, | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() { { "Steam", new ("981890", "musashi.exe") } } | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() { { "Steam", new("981890", "musashi.exe") } } | ||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||
| new() | ||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -91,8 +92,8 @@ public class ModdableGameLocator | |||||||||||||||||||||||||||||||||||||||||
| ModLoaderDownloadURL = Resources.HE2MLDownloadURL, | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() | ||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| { "Steam", new ("1237320", "SonicFrontiers.exe") }, | ||||||||||||||||||||||||||||||||||||||||||
| { "Epic", new ("c5ca98fa240c4eb796835f97126df8e7", "SonicFrontiers.exe") } | ||||||||||||||||||||||||||||||||||||||||||
| { "Steam", new("1237320", "SonicFrontiers.exe") }, | ||||||||||||||||||||||||||||||||||||||||||
| { "Epic", new("c5ca98fa240c4eb796835f97126df8e7", "SonicFrontiers.exe") } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||
| // NOTE: Mod loader is not ready yet | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -118,8 +119,8 @@ public class ModdableGameLocator | |||||||||||||||||||||||||||||||||||||||||
| ModDatabaseDirectoryName = "mods_shadow", | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() | ||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| { "Steam", new ("2513280", "SONIC_X_SHADOW_GENERATIONS.exe") }, | ||||||||||||||||||||||||||||||||||||||||||
| { "Epic", new ("a88805d3fbec4ca9bfc248105f6adb0a", "SONIC_X_SHADOW_GENERATIONS.exe") } | ||||||||||||||||||||||||||||||||||||||||||
| { "Steam", new("2513280", "SONIC_X_SHADOW_GENERATIONS.exe") }, | ||||||||||||||||||||||||||||||||||||||||||
| { "Epic", new("a88805d3fbec4ca9bfc248105f6adb0a", "SONIC_X_SHADOW_GENERATIONS.exe") } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||
| new() | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -128,9 +129,11 @@ public class ModdableGameLocator | |||||||||||||||||||||||||||||||||||||||||
| SupportsCodes = false, | ||||||||||||||||||||||||||||||||||||||||||
| PlatformInfos = new() | ||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| { "Windows", new (string.Empty, "SOFTWARE\\UnleashedRecomp") }, | ||||||||||||||||||||||||||||||||||||||||||
| { "Flatpak", new ("io.github.hedge_dev.unleashedrecomp", "unleashedrecomp")}, | ||||||||||||||||||||||||||||||||||||||||||
| { "Desktop", new ("UnleashedRecomp", "unleashedrecomp")} | ||||||||||||||||||||||||||||||||||||||||||
| { "Windows", new(string.Empty, "SOFTWARE\\UnleashedRecomp") }, | ||||||||||||||||||||||||||||||||||||||||||
| { "Flatpak", new("io.github.hedge_dev.unleashedrecomp", "unleashedrecomp") }, | ||||||||||||||||||||||||||||||||||||||||||
| { "Desktop", new("UnleashedRecomp", "unleashedrecomp") }, | ||||||||||||||||||||||||||||||||||||||||||
| // Uncomment to detect on mac | ||||||||||||||||||||||||||||||||||||||||||
| //{ "Macos", new("UnleashedRecomp", "UnleashedRecomp") }, | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -191,7 +194,7 @@ public static List<IModdableGame> LocateGames() | |||||||||||||||||||||||||||||||||||||||||
| Is64Bit = gameInfo.Is64Bit | ||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||
| game.ModDatabase.SupportsCodeCompilation = gameInfo.SupportsCodes; | ||||||||||||||||||||||||||||||||||||||||||
| game.ModLoader = new ModLoaderGeneric(game, game.ModLoaderName, | ||||||||||||||||||||||||||||||||||||||||||
| game.ModLoader = new ModLoaderGeneric(game, game.ModLoaderName, | ||||||||||||||||||||||||||||||||||||||||||
| gameInfo.ModLoaderFileName, gameInfo.ModLoaderIncompatibleFileNames, | ||||||||||||||||||||||||||||||||||||||||||
| gameInfo.ModLoaderDownloadURL, gameInfo.Is64Bit); | ||||||||||||||||||||||||||||||||||||||||||
| if (gameInfo.ModDatabaseDirectoryName != null) | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -304,6 +307,24 @@ public static List<IModdableGame> LocateGames() | |||||||||||||||||||||||||||||||||||||||||
| games.Add(game); | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| if (OperatingSystem.IsMacOS() && gameInfo.PlatformInfos.TryGetValue("Macos", out var macosDesktopInfo)) | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||
| // The root is actually not necessary on macos | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| // The root is actually not necessary on macos | |
| string root = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), | |
| "Library", "Application Support", "UnleashedRecomp"); | |
| if (Directory.Exists(root)) | |
| { | |
| var gameSimple = new GameSimple( | |
| "Macos", macosDesktopInfo.ID, gameInfo.ID, | |
| root, macosDesktopInfo.Executable, | |
| "Macos", "", "" | |
| ); | |
| var game = new ModdableGameGeneric(gameSimple) | |
| { | |
| SupportsDirectLaunch = true, | |
| SupportsLauncher = false, | |
| Is64Bit = gameInfo.Is64Bit | |
| }; | |
| game.ModDatabase.SupportsCodeCompilation = gameInfo.SupportsCodes; | |
| games.Add(game); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
Will try the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that Application Support should be accessed using Environment.SpecialFolder.ApplicationData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I tried to pull and build the project, it didn't work right. It wouldn't save config files or be able to boot the game. I tried fixing the code myself, but it still had trouble detecting mods and saving.
The suggested fixes above worked, and HMM runs great for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made changes to GameSimple, though it should be simple to work around for macOS. What I changed is making it work a bit more like running a command instead of executable and arguments.
Also please change all the Macos to macOS or MacOS, I think using the proper capitalisation would be good here.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to be careful assuming /Applications. Things can also be installed to ~/Applications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this is using
com.hedge_dev.hedgemodmanager? Isio.github.hedge_dev.hedgemodmanagerorcom.github.hedge_dev.hedgemodmanagerusable here? hedge-dev does not own/controlhedge_dev.com.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ID can be anything on macOS as long as the code is consistent. I've seen
com,org, andioin Mac app IDs before. I would make it the same as the Flatpak ID for consistency.