mirror of
https://github.com/LBPUnion/UnionPatcher.git
synced 2025-08-04 07:08:47 +00:00
Removed debug logging, made GetExecutablePath more robust.
This commit is contained in:
parent
36a17831e1
commit
71e24de72e
2 changed files with 5 additions and 5 deletions
|
@ -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 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 (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.
|
// 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.");
|
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!");
|
||||||
|
|
||||||
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)}");
|
|
||||||
SelectFolderDialog dialog = new SelectFolderDialog();
|
SelectFolderDialog dialog = new SelectFolderDialog();
|
||||||
if (dialog.ShowDialog(this) != DialogResult.Ok)
|
if (dialog.ShowDialog(this) != DialogResult.Ok)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,9 @@ namespace LBPUnion.UnionPatcher
|
||||||
var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
||||||
if (string.IsNullOrEmpty(path))
|
if (string.IsNullOrEmpty(path))
|
||||||
path = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName);
|
path = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName);
|
||||||
|
if (string.IsNullOrEmpty(path))
|
||||||
|
path = AppContext.BaseDirectory;
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue