1- using System ;
1+ using Microsoft . Win32 ;
2+ using System ;
23using System . Collections . Generic ;
34using System . Configuration ;
45using System . Diagnostics ;
56using System . IO ;
67using System . Net . NetworkInformation ;
78using System . Threading ;
8- using Microsoft . Win32 ;
99
1010namespace Uninstall
1111{
@@ -38,7 +38,7 @@ internal static void BackupConfigurationFile()
3838 {
3939 try
4040 {
41- var sdcConfig = Path . Combine ( Directory . GetCurrentDirectory ( ) , "SimpleDnsCrypt.exe.config" ) ;
41+ var sdcConfig = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "SimpleDnsCrypt.exe.config" ) ;
4242 if ( ! File . Exists ( sdcConfig ) ) return ;
4343 var sdcConfigMap = new ExeConfigurationFileMap
4444 {
@@ -51,7 +51,7 @@ internal static void BackupConfigurationFile()
5151 var setting = section . Settings . Get ( "BackupAndRestoreConfigOnUpdate" ) ;
5252 var backupAndRestoreConfigOnUpdate = Convert . ToBoolean ( setting . Value . ValueXml . LastChild . InnerText ) ;
5353 if ( ! backupAndRestoreConfigOnUpdate ) return ;
54- var config = Path . Combine ( Directory . GetCurrentDirectory ( ) , DnsCryptProxyFolder ,
54+ var config = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , DnsCryptProxyFolder ,
5555 DnsCryptProxyConfigName ) ;
5656 if ( ! File . Exists ( config ) ) return ;
5757 var tmp = Path . Combine ( Path . GetTempPath ( ) , DnsCryptProxyConfigName + ".bak" ) ;
@@ -90,7 +90,8 @@ internal static void ExecuteWithArguments(string arguments)
9090 const int timeout = 9000 ;
9191 using ( var process = new Process ( ) )
9292 {
93- process . StartInfo . FileName = Path . Combine ( Directory . GetCurrentDirectory ( ) , DnsCryptProxyFolder , DnsCryptProxyExecutableName ) ;
93+ process . StartInfo . FileName = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory ,
94+ DnsCryptProxyFolder , DnsCryptProxyExecutableName ) ;
9495 process . StartInfo . Arguments = arguments ;
9596 process . StartInfo . UseShellExecute = false ;
9697 process . StartInfo . CreateNoWindow = true ;
0 commit comments