Fix issue in PortableDataLocationInUse

This commit is contained in:
Jack251970 2025-09-21 20:07:18 +08:00
parent d7e1ad73cc
commit 6fca1c919e
2 changed files with 5 additions and 4 deletions

View file

@ -7,8 +7,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings
{
public const string PortableFolderName = "UserData";
public const string DeletionIndicatorFile = ".dead";
public static string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName);
public static string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher");
public static readonly string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName);
public static readonly string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher");
public static string DataDirectory()
{
if (PortableDataLocationInUse())
@ -19,7 +19,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public static bool PortableDataLocationInUse()
{
if (Directory.Exists(PortableDataPath) && !File.Exists(DeletionIndicatorFile))
if (Directory.Exists(PortableDataPath) &&
!File.Exists(Path.Combine(PortableDataPath, DeletionIndicatorFile)))
return true;
return false;

View file

@ -123,7 +123,7 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
}
// This is only required to set at startup. When portable mode enabled/disabled a restart is always required
private static bool _portableMode = DataLocation.PortableDataLocationInUse();
private static readonly bool _portableMode = DataLocation.PortableDataLocationInUse();
public bool PortableMode
{