From 54979b76461438205b9e35de89cf865a96517510 Mon Sep 17 00:00:00 2001 From: Christian Hermann Date: Sat, 1 Dec 2018 10:14:27 +0100 Subject: [PATCH] Fix Uninstall Fixed the path to the dnscrypt-proxy files --- Uninstall/Program.cs | 11 ++++++----- Uninstall/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Uninstall/Program.cs b/Uninstall/Program.cs index 16142e9a..c0234a92 100644 --- a/Uninstall/Program.cs +++ b/Uninstall/Program.cs @@ -1,11 +1,11 @@ -using System; +using Microsoft.Win32; +using System; using System.Collections.Generic; using System.Configuration; using System.Diagnostics; using System.IO; using System.Net.NetworkInformation; using System.Threading; -using Microsoft.Win32; namespace Uninstall { @@ -38,7 +38,7 @@ internal static void BackupConfigurationFile() { try { - var sdcConfig = Path.Combine(Directory.GetCurrentDirectory(), "SimpleDnsCrypt.exe.config"); + var sdcConfig = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SimpleDnsCrypt.exe.config"); if (!File.Exists(sdcConfig)) return; var sdcConfigMap = new ExeConfigurationFileMap { @@ -51,7 +51,7 @@ internal static void BackupConfigurationFile() var setting = section.Settings.Get("BackupAndRestoreConfigOnUpdate"); var backupAndRestoreConfigOnUpdate = Convert.ToBoolean(setting.Value.ValueXml.LastChild.InnerText); if (!backupAndRestoreConfigOnUpdate) return; - var config = Path.Combine(Directory.GetCurrentDirectory(), DnsCryptProxyFolder, + var config = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, DnsCryptProxyFolder, DnsCryptProxyConfigName); if (!File.Exists(config)) return; var tmp = Path.Combine(Path.GetTempPath(), DnsCryptProxyConfigName + ".bak"); @@ -90,7 +90,8 @@ internal static void ExecuteWithArguments(string arguments) const int timeout = 9000; using (var process = new Process()) { - process.StartInfo.FileName = Path.Combine(Directory.GetCurrentDirectory(), DnsCryptProxyFolder, DnsCryptProxyExecutableName); + process.StartInfo.FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, + DnsCryptProxyFolder, DnsCryptProxyExecutableName); process.StartInfo.Arguments = arguments; process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; diff --git a/Uninstall/Properties/AssemblyInfo.cs b/Uninstall/Properties/AssemblyInfo.cs index fda1afd2..1db14a29 100644 --- a/Uninstall/Properties/AssemblyInfo.cs +++ b/Uninstall/Properties/AssemblyInfo.cs @@ -11,5 +11,5 @@ [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("1a9ca4fe-bdd5-4d7c-a86a-7ed503974718")] -[assembly: AssemblyVersion("0.2.3")] -[assembly: AssemblyFileVersion("0.2.3")] +[assembly: AssemblyVersion("0.2.4")] +[assembly: AssemblyFileVersion("0.2.4")]