diff --git a/Flow.Launcher.Core/Flow.Launcher.Core.csproj b/Flow.Launcher.Core/Flow.Launcher.Core.csproj
index d3199654d..6a3876d06 100644
--- a/Flow.Launcher.Core/Flow.Launcher.Core.csproj
+++ b/Flow.Launcher.Core/Flow.Launcher.Core.csproj
@@ -57,7 +57,7 @@
-
+
diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs
index 3c20cf0b7..5b67ffabc 100644
--- a/Flow.Launcher.Core/Updater.cs
+++ b/Flow.Launcher.Core/Updater.cs
@@ -49,7 +49,8 @@ namespace Flow.Launcher.Core
// UpdateApp CheckForUpdate will return value only if the app is squirrel installed
var newUpdateInfo = await updateManager.CheckForUpdate().NonNull().ConfigureAwait(false);
- var newReleaseVersion = SemanticVersioning.Version.Parse(newUpdateInfo.FutureReleaseEntry.Version.ToString());
+ var newReleaseVersion =
+ SemanticVersioning.Version.Parse(newUpdateInfo.FutureReleaseEntry.Version.ToString());
var currentVersion = SemanticVersioning.Version.Parse(Constant.Version);
_api.LogInfo(ClassName, $"Future Release <{Formatted(newUpdateInfo.FutureReleaseEntry)}>");
@@ -71,10 +72,13 @@ namespace Flow.Launcher.Core
if (DataLocation.PortableDataLocationInUse())
{
- var targetDestination = updateManager.RootAppDirectory + $"\\app-{newReleaseVersion}\\{DataLocation.PortableFolderName}";
+ var targetDestination = updateManager.RootAppDirectory +
+ $"\\app-{newReleaseVersion}\\{DataLocation.PortableFolderName}";
FilesFolders.CopyAll(DataLocation.PortableDataPath, targetDestination, (s) => _api.ShowMsgBox(s));
- if (!FilesFolders.VerifyBothFolderFilesEqual(DataLocation.PortableDataPath, targetDestination, (s) => _api.ShowMsgBox(s)))
- _api.ShowMsgBox(string.Format(_api.GetTranslation("update_flowlauncher_fail_moving_portable_user_profile_data"),
+ if (!FilesFolders.VerifyBothFolderFilesEqual(DataLocation.PortableDataPath, targetDestination,
+ (s) => _api.ShowMsgBox(s)))
+ _api.ShowMsgBox(string.Format(
+ _api.GetTranslation("update_flowlauncher_fail_moving_portable_user_profile_data"),
DataLocation.PortableDataPath,
targetDestination));
}
@@ -87,22 +91,25 @@ namespace Flow.Launcher.Core
_api.LogInfo(ClassName, $"Update success:{newVersionTips}");
- if (_api.ShowMsgBox(newVersionTips, _api.GetTranslation("update_flowlauncher_new_update"), MessageBoxButton.YesNo) == MessageBoxResult.Yes)
+ if (_api.ShowMsgBox(newVersionTips, _api.GetTranslation("update_flowlauncher_new_update"),
+ MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
UpdateManager.RestartApp(Constant.ApplicationFileName);
}
}
catch (Exception e)
{
- if (e is HttpRequestException or WebException or SocketException || e.InnerException is TimeoutException)
+ if (e is HttpRequestException or WebException or SocketException ||
+ e.InnerException is TimeoutException)
{
- _api.LogException(ClassName, $"Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e);
+ _api.LogException(ClassName,
+ $"Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e);
}
else
{
_api.LogException(ClassName, $"Error Occurred", e);
}
-
+
if (!silentUpdate)
_api.ShowMsg(_api.GetTranslation("update_flowlauncher_fail"),
_api.GetTranslation("update_flowlauncher_check_connection"));
@@ -116,14 +123,11 @@ namespace Flow.Launcher.Core
[UsedImplicitly]
private class GithubRelease
{
- [JsonPropertyName("prerelease")]
- public bool Prerelease { get; [UsedImplicitly] set; }
+ [JsonPropertyName("prerelease")] public bool Prerelease { get; [UsedImplicitly] set; }
- [JsonPropertyName("published_at")]
- public DateTime PublishedAt { get; [UsedImplicitly] set; }
+ [JsonPropertyName("published_at")] public DateTime PublishedAt { get; [UsedImplicitly] set; }
- [JsonPropertyName("html_url")]
- public string HtmlUrl { get; [UsedImplicitly] set; }
+ [JsonPropertyName("html_url")] public string HtmlUrl { get; [UsedImplicitly] set; }
}
// https://github.com/Squirrel/Squirrel.Windows/blob/master/src/Squirrel/UpdateManager.Factory.cs
@@ -135,13 +139,10 @@ namespace Flow.Launcher.Core
await using var jsonStream = await Http.GetStreamAsync(api).ConfigureAwait(false);
var releases = await JsonSerializer.DeserializeAsync>(jsonStream).ConfigureAwait(false);
- var latest = releases.OrderByDescending(r => r.PublishedAt).First();
+ var latest = releases.Where(r => !r.Prerelease).OrderByDescending(r => r.PublishedAt).First();
var latestUrl = latest.HtmlUrl.Replace("/tag/", "/download/");
- var client = new WebClient
- {
- Proxy = Http.WebProxy
- };
+ var client = new WebClient { Proxy = Http.WebProxy };
var downloader = new FileDownloader(client);
var manager = new UpdateManager(latestUrl, urlDownloader: downloader);
@@ -158,10 +159,7 @@ namespace Flow.Launcher.Core
private static string Formatted(T t)
{
- var formatted = JsonSerializer.Serialize(t, new JsonSerializerOptions
- {
- WriteIndented = true
- });
+ var formatted = JsonSerializer.Serialize(t, new JsonSerializerOptions { WriteIndented = true });
return formatted;
}