Start Tor automatically on Windows for tests
ADD
WalletWasabi/TorDaemons/tor-win32.zip
WalletWasabi/TorDaemons/tor-win32.zip
Binary files /dev/null and b/WalletWasabi/TorDaemons/tor-win32.zip differ

MODIFY
WalletWasabi/TorSocks5/TorProcessManager.cs
WalletWasabi/TorSocks5/TorProcessManager.cs
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+using System.IO.Compression;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
@@ -45,9 +46,26 @@ namespace WalletWasabi.TorSocks5
}
if (!File.Exists(torPath))
+ {
+ var torDir = Path.Combine(AppContext.BaseDirectory, "tor");
+ var torDaemonsDir = $"TorDaemons";
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ try
+ {
+ ZipFile.ExtractToDirectory(Path.Combine(torDaemonsDir, "tor-win32.zip"), torDir);
+ }
+ catch (UnauthorizedAccessException)
+ {
+ await Task.Delay(100);
+ ZipFile.ExtractToDirectory(Path.Combine(torDaemonsDir, "tor-win32.zip"), torDir);
+ }
+ }
+ else
{
throw new NotImplementedException();
}
+ }
var torProcessStartInfo = new ProcessStartInfo(torPath)
{

MODIFY
WalletWasabi/WalletWasabi.csproj
WalletWasabi/WalletWasabi.csproj
<ItemGroup>
<Folder Include="Gma\QrCodeNet\Encoding\ReedSolomon\" />
+ <Folder Include="TorDaemons\" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <None Update="TorDaemons\tor-win32.zip">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
</Project>

Start Tor automatically on Windows for tests