Skip to content

Commit

Permalink
Require staging directory as fallback (#34)
Browse files Browse the repository at this point in the history
* Test requiring staging directory on Windows

* Special workaround v1

* Remove variable since its only used once
  • Loading branch information
daggintosh authored Mar 19, 2023
1 parent 47af7d6 commit 7b88e27
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions UnionPatcher.Gui/Forms/ModeSelectionForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ public ModeSelectionForm() {

private void openRemotePatcher(object sender, EventArgs e)
{
if (OSUtil.GetPlatform() == OSPlatform.OSX)
if (!Directory.Exists("scetool"))
{
Gui.CreateOkDialog("Workaround", "UnionPatcher RemotePatcher requires a staging folder on macOS, please set this to the directory of the UnionPatcher app!");
// 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!");
SelectFolderDialog dialog = new SelectFolderDialog();
if (dialog.ShowDialog(this) != DialogResult.Ok)
{
Expand All @@ -41,7 +44,7 @@ private void openRemotePatcher(object sender, EventArgs e)
Directory.SetCurrentDirectory(dialog.Directory);
if (!Directory.Exists("scetool"))
{
Gui.CreateOkDialog("Workaround", "Invalid folder, remember to set the folder to the directory of the UnionPatcher app!");
Gui.CreateOkDialog("Workaround", "Invalid folder, remember to set the folder to the directory of the UnionPatcher app or executable!");
return;
}
}
Expand Down

0 comments on commit 7b88e27

Please sign in to comment.