Skip to content

Commit 1af4867

Browse files
authored
Use tor-win64 when running on X64 Windows (#78)
The releases contain tor-win64, which should be used when running on Windows X64. instead of hardcoding win-32. Fixes #74
1 parent 2d2e284 commit 1af4867

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/TorSharp/ToolUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static ToolSettings GetTorToolSettings(TorSharpSettings settings)
109109
return new ToolSettings
110110
{
111111
Name = TorName,
112-
Prefix = "tor-win32-",
112+
Prefix = settings.Architecture == TorSharpArchitecture.X64 ? "tor-win64-" : "tor-win32-",
113113
ExecutablePathOverride = settings.TorSettings.ExecutablePathOverride,
114114
ExecutablePath = Path.Combine(TorName, "tor.exe"),
115115
WorkingDirectory = TorName,

src/TorSharp/Tools/Tor/TorFetcher.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ private FileNamePatternAndFormat GetFileNamePatternAndFormat()
4444
var format = default(ZippedToolFormat);
4545
if (_settings.OSPlatform == TorSharpOSPlatform.Windows)
4646
{
47-
pattern = @"tor-win32-(?<Version>[\d\.]+)\.zip$";
47+
if (_settings.Architecture == TorSharpArchitecture.X64)
48+
{
49+
pattern = @"tor-win64-(?<Version>[\d\.]+)\.zip$";
50+
}
51+
else
52+
{
53+
pattern = @"tor-win32-(?<Version>[\d\.]+)\.zip$";
54+
}
4855
format = ZippedToolFormat.Zip;
4956
}
5057
else if (_settings.OSPlatform == TorSharpOSPlatform.Linux)

0 commit comments

Comments
 (0)