From 0682c240728f816b29bf2292350296c5e4d5b256 Mon Sep 17 00:00:00 2001 From: Vasilis Date: Fri, 26 Jul 2024 23:58:44 +0300 Subject: [PATCH] Fix macos kinda --- SS14.Launcher/App.xaml.cs | 5 +++-- SS14.Launcher/ProtocolSetup.cs | 9 +-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/SS14.Launcher/App.xaml.cs b/SS14.Launcher/App.xaml.cs index a7a8654c..3cd5885c 100644 --- a/SS14.Launcher/App.xaml.cs +++ b/SS14.Launcher/App.xaml.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; @@ -38,13 +39,13 @@ public App(OverrideAssetsManager overrideAssets) UrlsOpened += OnOSXUrlsOpened; } - private void OnOSXUrlsOpened(object? sender, UrlOpenedEventArgs e) + public void OnOSXUrlsOpened(object? sender, UrlOpenedEventArgs e) { // I think this only works on macOS anyway? Well i will leave this here just so I don't surprise myself later. if (!OperatingSystem.IsMacOS()) return; - Log.Debug($"MacOS launch arg is {e.Urls}. Doing nothing since i did not implement this yet lol"); + Log.Debug($"MacOS launch arg is {e.Urls.FirstOrDefault()}. Doing nothing since i did not implement this yet lol"); } public override void Initialize() diff --git a/SS14.Launcher/ProtocolSetup.cs b/SS14.Launcher/ProtocolSetup.cs index 27a26016..b43bee8a 100644 --- a/SS14.Launcher/ProtocolSetup.cs +++ b/SS14.Launcher/ProtocolSetup.cs @@ -66,20 +66,13 @@ public static void RegisterProtocol() if (OperatingSystem.IsMacOS()) { // Yeah you cant get this to work on dev builds - //todo macos protocol pass params #if !FULL_RELEASE return; #endif var path = $"{AppDomain.CurrentDomain.BaseDirectory}"; - // > be me - // > write protocol registration code - // > application runs in some wierd sandbox folder - // > :despair: - // > find out its about that its cause the user needs to move the app to the applications folder... - // > ... or any "suitable" folder... // tldr user needs to move the app manually to get this sandbox restriction lifted. This can be done by - // making one of those installer dmg stuff + // making one of those installer dmg stuff... for now lets just stop if (path.Contains("AppTranslocation")) { Log.Error("I have been put in apple jail... move me to your application folder");