Skip to content

Commit

Permalink
Attempt to correctly set macOS app bundle pwd
Browse files Browse the repository at this point in the history
  • Loading branch information
sudokoko committed Aug 15, 2023
1 parent fc58962 commit d82ec23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions PLRPC.GUI.MacOS/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ public static class Program
[STAThread]
public static void Main()
{
/*
* Attempt to set the current directory to the directory of the app bundle as
* macOS application bundles have their default pwd set to /.
*
* We'll just fall back to "../" if this fails.
*/
Directory.SetCurrentDirectory(Path.GetDirectoryName(Environment.ProcessPath) ?? "../");

Gui.Initialize();
}
}

0 comments on commit d82ec23

Please sign in to comment.