Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Commit f00d70e

Browse files
committed
Fix issues with the Protobuild Manager on macOS
1 parent f2c7391 commit f00d70e

6 files changed

Lines changed: 1759 additions & 45 deletions

File tree

Build/Projects/Protobuild.Manager.ThirdParty.definition

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<Reference Include="System.Web.Extensions" />
4141
<Reference Include="System.Windows.Forms" />
4242
<Reference Include="System.Xml" />
43+
<Reference Include="System.Runtime" />
4344
<Reference Include="Microsoft.CSharp" />
4445
</Platform>
4546

Build/Projects/Protobuild.Manager.definition

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<Compile Include="Execution\WindowsExecution.cs" />
5151
<Compile Include="GameUpdater.cs" />
5252
<Compile Include="Gtk3WebKit.cs" />
53+
<Compile Include="HttpUtility.cs" />
5354
<Compile Include="IDEAddinInstall\AddinPackageDownload.cs" />
5455
<Compile Include="IDEAddinInstall\IAddinPackageDownload.cs" />
5556
<Compile Include="IDEAddinInstall\IIDEAddinInstall.cs" />

Protobuild.Manager/Execution/MacOSExecution.cs

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,39 @@ public Process ExecuteConsoleExecutable(string path, string arguments, Action<Pr
1818
throw new Exception("Can't mark console program as executable");
1919
}
2020

21-
var mono = "/usr/bin/mono";
22-
if (!File.Exists(mono) && File.Exists("/usr/local/bin/mono"))
21+
string mono = null;
22+
var basePaths = Environment.GetEnvironmentVariable("PATH");
23+
foreach (var basePath in basePaths.Split(':'))
24+
{
25+
var monoPath = Path.Combine(basePath, "mono");
26+
if (File.Exists(monoPath))
27+
{
28+
mono = monoPath;
29+
break;
30+
}
31+
}
32+
if (mono == null)
2333
{
24-
mono = "/usr/local/bin/mono";
25-
}
34+
var monoPaths = new[]
35+
{
36+
"/usr/bin/mono",
37+
"/usr/local/bin/mono",
38+
"/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono"
39+
};
40+
foreach (var monoPath in monoPaths)
41+
{
42+
if (File.Exists(monoPath))
43+
{
44+
mono = monoPath;
45+
break;
46+
}
47+
}
48+
}
49+
50+
if (mono == null)
51+
{
52+
throw new InvalidOperationException("Unable to locate Mono! Make sure it is on your PATH.");
53+
}
2654

2755
var startInfo = new ProcessStartInfo();
2856
startInfo.FileName = mono;

0 commit comments

Comments
 (0)