Merge pull request #3999 from Flow-Launcher/portable_mode_fix

Fix PortableMode Check Issue
This commit is contained in:
Jack Ye 2025-09-21 20:23:39 +08:00 committed by GitHub
commit 35867a0a00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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
{