mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-30 14:56:19 +00:00
StartupPath optional LocalApplicationData
This commit is contained in:
parent
a6e246948a
commit
6983d21ddc
1 changed files with 9 additions and 2 deletions
|
@ -693,9 +693,16 @@ namespace ServiceLib.Common
|
|||
return Environment.ProcessPath ?? Process.GetCurrentProcess().MainModule?.FileName ?? string.Empty;
|
||||
}
|
||||
|
||||
public static string StartupPath()
|
||||
{
|
||||
public static string StartupPath() {
|
||||
try {
|
||||
string tempPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "guiConfigs");
|
||||
if (!Directory.Exists(tempPath)) {
|
||||
Directory.CreateDirectory(tempPath);
|
||||
}
|
||||
return AppDomain.CurrentDomain.BaseDirectory;
|
||||
} catch (IOException) {
|
||||
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "v2rayN");
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetTempPath(string filename = "")
|
||||
|
|
Loading…
Reference in a new issue