Improve the code and keeping the immediate correction of fullBaseDirectory
MODIFY
WalletWasabi/Hwi/HwiProcessManager.cs
WalletWasabi/Hwi/HwiProcessManager.cs
@@ -213,18 +213,18 @@ namespace WalletWasabi.Hwi
Network = network;
var fullBaseDirectory = Path.GetFullPath(AppContext.BaseDirectory);
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- HwiPath = Path.Combine(fullBaseDirectory, "Hwi", "Software", "hwi-win64", "hwi.exe");
- return;
- }
- else
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
if (!fullBaseDirectory.StartsWith('/'))
{
fullBaseDirectory.Insert(0, "/");
}
}
+ else
+ {
+ HwiPath = Path.Combine(fullBaseDirectory, "Hwi", "Software", "hwi-win64", "hwi.exe");
+ return;
+ }
var hwiDir = Path.Combine(dataDir, "hwi");
string hwiPath = $@"{hwiDir}/hwi";

MODIFY
WalletWasabi/TorSocks5/TorProcessManager.cs
WalletWasabi/TorSocks5/TorProcessManager.cs
@@ -70,12 +70,7 @@ namespace WalletWasabi.TorSocks5
var torDir = Path.Combine(dataDir, "tor");
var torPath = "";
var fullBaseDirectory = Path.GetFullPath(AppContext.BaseDirectory);
-
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- torPath = $@"{torDir}\Tor\tor.exe";
- }
- else // Linux or OSX
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
if (!fullBaseDirectory.StartsWith('/'))
{
@@ -84,6 +79,10 @@ namespace WalletWasabi.TorSocks5
torPath = $@"{torDir}/Tor/tor";
}
+ else // If Windows
+ {
+ torPath = $@"{torDir}\Tor\tor.exe";
+ }
if (!File.Exists(torPath))
{

Improve the code and keeping the immediate correction of fullBaseDirectory