change the version being used and portable datafolder creation for non-standard installation

This commit is contained in:
Hongtao Zhang 2024-03-27 16:54:35 -05:00
parent 742604cb97
commit c563035cce
2 changed files with 11 additions and 12 deletions

View file

@ -81,18 +81,17 @@ namespace Flow.Launcher.Core.Configuration
public void PreStartCleanUpAfterPortabilityUpdate()
{
var locator = VelopackLocator.GetDefault(null);
// this would not happen for development environment
if (locator.PackagesDir != null)
// check whether the package locate in %localappdata%
// if not create the portable data folder
// Don't create the folder if the version is 1.0.0 (Dev) to allow potential debugging with data in the project folder
// It is still possible to create the UserData folder for dev version manually but we want to keep the current behavior
if (!Constant.ProgramDirectory.IsSubPathOf(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData))
&& !DataLocation.PortableDataPath.LocationExists()
&& Constant.Version != "1.0.0")
{
// check whether the package locate in %localappdata%
// if not create the portable data folder
if (!locator.PackagesDir.IsSubPathOf(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData))
&& !DataLocation.PortableDataPath.LocationExists())
{
Directory.CreateDirectory(DataLocation.PortableDataPath);
}
Directory.CreateDirectory(DataLocation.PortableDataPath);
}
// Specify here so this method does not rely on other environment variables to initialise

View file

@ -20,7 +20,7 @@ namespace Flow.Launcher.Infrastructure
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
public const string IssuesUrl = "https://github.com/Flow-Launcher/Flow.Launcher/issues";
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion;
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).FileVersion;
public static readonly string Dev = "Dev";
public const string Documentation = "https://flowlauncher.com/docs/#/usage-tips";