From 025c5039639d34d1b18aeb5a33a6964269fe6403 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 16 Jun 2024 17:45:39 -0500 Subject: [PATCH] add authors and slight refactor to make code cleaner --- Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs | 4 +++- Scripts/post_build.ps1 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs b/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs index 4cab11ba2..2631dc085 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs @@ -14,7 +14,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings // It is still possible to create the UserData folder for dev version manually but we want to keep the current behavior if (!Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) .PathContains(Constant.ProgramDirectory) - && Constant.Version != "1.0.0") + && !IsDevVersion) { Directory.CreateDirectory(PortableDataPath); } @@ -30,6 +30,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings public static string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher"); + public static bool IsDevVersion => Constant.Version == "1.0.0"; + public static string DataDirectory() { if (PortableDataLocationInUse()) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index e8a098696..a6c319494 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -125,7 +125,7 @@ function Pack-Velopack-Installer($path, $version, $output) # FIXME userdata should not be created in installer version # New-Item -ItemType Directory -Force -Path "$input\UserData" - vpk pack --packVersion $version --packDir $input --packId FlowLauncher --mainExe Flow.Launcher.exe --channel $channel --outputDir $output --packTitle "Flow Launcher" --icon "$input\Images\app.ico" + vpk pack --packVersion $version --packDir $input --packId FlowLauncher --mainExe Flow.Launcher.exe --channel $channel --outputDir $output --packTitle "Flow Launcher" --icon "$input\Images\app.ico" --packAuthors "Flow-Launcher Team" } function Publish-Self-Contained($p)