Use paths relative to the location of the executable and not absolute paths.

This allows the executable to be relocated without issues with the configuration files.
This commit is contained in:
2024-03-07 19:19:22 -05:00
parent e297cfb710
commit 9e45b418f9
34 changed files with 74 additions and 48 deletions

View File

@@ -15,6 +15,7 @@ using MarketData;
using MarketData.Utils;
using Utility=MarketData.Utils.Utility;
// This project must be built in 32 bit mode. Due to the size of IntPtr being 64 and not 32 as needed.
// Tor Current Version
// https://www.torproject.org/download/tor/
@@ -269,7 +270,9 @@ namespace TorWebClient
{
try
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Creating {0}",pathTorConfig));
String currentWorkingDirectory = Directory.GetCurrentDirectory();
pathTorConfig=currentWorkingDirectory+@"\Tor\Tor\"+pathTorConfig;
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("Creating {0} ",pathTorConfig));
String pathBackupTorConfig=pathTorConfig+".bak";
if(File.Exists(pathTorConfig))
{
@@ -439,7 +442,6 @@ namespace TorWebClient
}
static void Main(string[] args)
{
Console.WriteLine("TorWebClient is running {0} bits.",Utility.Is64Bit()?64:32);
try{Program.SetConsoleCtrlHandler(new HandlerRoutine(Program.ConsoleCtrlCheck),true);}
catch(Exception exception){Console.WriteLine(exception.ToString());}
if(!Utility.IsAdministrator())