Add linux and osx hwi binaries.
MODIFY
WalletWasabi/Helpers/EnvironmentHelpers.cs
WalletWasabi/Helpers/EnvironmentHelpers.cs
@@ -191,5 +191,20 @@ namespace WalletWasabi.Helpers
}
return false;
}
+
+ public static string GetFullBaseDirectory()
+ {
+ var fullBaseDirectory = Path.GetFullPath(AppContext.BaseDirectory);
+
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ if (!fullBaseDirectory.StartsWith('/'))
+ {
+ fullBaseDirectory.Insert(0, "/");
+ }
+ }
+
+ return fullBaseDirectory;
+ }
}
}

MODIFY
WalletWasabi/Hwi/HwiProcessManager.cs
WalletWasabi/Hwi/HwiProcessManager.cs
@@ -213,14 +213,7 @@ namespace WalletWasabi.Hwi
{
Network = network;
- var fullBaseDirectory = Path.GetFullPath(AppContext.BaseDirectory);
- if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- if (!fullBaseDirectory.StartsWith('/'))
- {
- fullBaseDirectory.Insert(0, "/");
- }
- }
+ var fullBaseDirectory = EnvironmentHelpers.GetFullBaseDirectory();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{

ADD
WalletWasabi/Hwi2/Binaries/hwi-lin64/hwi
WalletWasabi/Hwi2/Binaries/hwi-lin64/hwi
Binary files /dev/null and b/WalletWasabi/Hwi2/Binaries/hwi-lin64/hwi differ

ADD
WalletWasabi/Hwi2/Binaries/hwi-osx64/hwi
WalletWasabi/Hwi2/Binaries/hwi-osx64/hwi
Binary files /dev/null and b/WalletWasabi/Hwi2/Binaries/hwi-osx64/hwi differ

MODIFY
WalletWasabi/Hwi2/HwiClient.cs
WalletWasabi/Hwi2/HwiClient.cs
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
+using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -198,8 +199,26 @@ namespace WalletWasabi.Hwi2
private static string GetHwiPath()
{
- var fullBaseDirectory = Path.GetFullPath(AppContext.BaseDirectory);
- var hwiPath = Path.Combine(fullBaseDirectory, "Hwi2", "Binaries", "hwi-win64", "hwi.exe");
+ var fullBaseDirectory = EnvironmentHelpers.GetFullBaseDirectory();
+
+ string hwiPartialPath;
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ hwiPartialPath = Path.Combine("Hwi2", "Binaries", "hwi-win64", "hwi.exe");
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ hwiPartialPath = Path.Combine("Hwi2", "Binaries", "hwi-lin64", "hwi");
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ hwiPartialPath = Path.Combine("Hwi2", "Binaries", "hwi-osx64", "hwi");
+ }
+ else
+ {
+ throw new NotSupportedException("Operating system is not supported.");
+ }
+ var hwiPath = Path.Combine(fullBaseDirectory, hwiPartialPath);
return hwiPath;
}

MODIFY
WalletWasabi/WalletWasabi.csproj
WalletWasabi/WalletWasabi.csproj
<ItemGroup>
<Folder Include="Gma\QrCodeNet\Encoding\ReedSolomon\" />
<Folder Include="Hwi2\Binaries\hwi-win64\" />
+ <Folder Include="Hwi2\Binaries\hwi-osx64\" />
+ <Folder Include="Hwi2\Binaries\hwi-lin64\" />
</ItemGroup>
<ItemGroup>
+ <None Update="Hwi2\Binaries\hwi-lin64\hwi">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Update="Hwi2\Binaries\hwi-osx64\hwi">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<None Update="Hwi2\Binaries\hwi-win64\hwi.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>

Add linux and osx hwi binaries.