diff --git a/UnionPatcher.Gui/Forms/ModeSelectionForm.cs b/UnionPatcher.Gui/Forms/ModeSelectionForm.cs index 8116896..e8bf97c 100644 --- a/UnionPatcher.Gui/Forms/ModeSelectionForm.cs +++ b/UnionPatcher.Gui/Forms/ModeSelectionForm.cs @@ -35,15 +35,12 @@ public class ModeSelectionForm : Form { // If we're on macOS then set the CWD to the app bundle MacOS folder, so that SCETool can be found. if (OSUtil.GetPlatform() == OSPlatform.OSX) Directory.SetCurrentDirectory(OSUtil.GetExecutablePath()); - if (!Directory.Exists("scetool")) + if (!Directory.Exists(OSUtil.GetExecutablePath()+"/scetool")) { // This will always occur on macOS, so don't show this message for macOS users. if (OSUtil.GetPlatform() != OSPlatform.OSX) Gui.CreateOkDialog("Workaround Triggered", ".NET could not locate the required files, triggering workaround."); - - - Gui.CreateOkDialog("Workaround", - $"UnionPatcher RemotePatcher requires a staging folder on macOS or in special circumstances on Windows, please set this to the directory of the UnionPatcher app or executable! {EtoEnvironment.GetFolderPath(EtoSpecialFolder.ApplicationResources)}"); + Gui.CreateOkDialog("Workaround", "UnionPatcher RemotePatcher requires a staging folder on macOS or in special circumstances on Windows, please set this to the directory of the UnionPatcher app or executable!"); SelectFolderDialog dialog = new SelectFolderDialog(); if (dialog.ShowDialog(this) != DialogResult.Ok) { diff --git a/UnionPatcher/OSUtil.cs b/UnionPatcher/OSUtil.cs index 30e6a90..4aa26f3 100644 --- a/UnionPatcher/OSUtil.cs +++ b/UnionPatcher/OSUtil.cs @@ -38,6 +38,9 @@ namespace LBPUnion.UnionPatcher var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location); if (string.IsNullOrEmpty(path)) path = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName); + if (string.IsNullOrEmpty(path)) + path = AppContext.BaseDirectory; + return path; } }