If it is a Windows WinGet installation, the configuration file is stored in the user directory

https://github.com/2dust/v2rayN/issues/6803
pull/6900/head
2dust 2025-03-09 19:04:49 +08:00
parent e6011cfede
commit 2df412476a
1 changed files with 9 additions and 2 deletions

View File

@ -564,13 +564,20 @@ namespace ServiceLib.Common
{
try
{
var basePath = GetBaseDirectory();
//When this file exists, it is equivalent to having no permission to read and write
if (File.Exists(Path.Combine(GetBaseDirectory(), "NotStoreConfigHere.txt")))
if (File.Exists(Path.Combine(basePath, "NotStoreConfigHere.txt")))
{
return false;
}
var tempPath = Path.Combine(GetBaseDirectory(), "guiTemps");
//Check if it is installed by Windows WinGet
if (IsWindows() && basePath.Contains("Users") && basePath.Contains("WinGet"))
{
return false;
}
var tempPath = Path.Combine(basePath, "guiTemps");
if (!Directory.Exists(tempPath))
{
Directory.CreateDirectory(tempPath);