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zu$+Hp{7kM`4qKd7p63yNfe~Qwm!hR5w5m6UTc89HhP8Kl%W1{(A&K1`wm=OSYiAtT
z(!-tO6y1M%)xmiJr|SR18D7#b6%FBHo+0aDzBkU@4rzaSq2e~vdm$NlM}J&b%rfBp
zwUW;a&3kfVJ%~U42>Dh$Iv$(9i^+K5^YJ`5=TmUc(
z8I3EaUOp*Stw*49u129XeBo07=I~^T
zP|kKA@ihm^qLTitboU!weB$)$dKp&VCIpTVhh>R^*k|WB$7$2_R4-ELWkjDDCQhl}
zmjDb{0WofNyTpgNV@KX`IOj=k&Ddb7_>LGzQ}
zdg=EkxR`HceK2-oCcWdBd{}CCoE#B-F-!CriD3bqk{;T%l64w41LSRYVlncnmts<6
z+xVBrK2$>{RBN|UM9CJ-0%nohfBKt^Wm`!M`w%LC3!YwcpUz#xA}Ozni~#G6w?(&
ze%3jyZIVA`@kZJRNF2iQ-P~)75k*DFu9Z})IzG#mHxJKgFY$F>;o+%tSwX
z^^A$OQ;Fj-Pf|<6s-f)(szwT%(!}Cj_T^^8VFa5ZAknC9-I5bMwNcQ^(C_JKz-;5Xhg4nQ%J4
zS+d2*EUt8jgv*FJKI$tWQu8o~X(-nJv<&JN!|_ty7ObxJY0)up)YHD&b4z2Xx>E1d
xxik6###G;n$dI;pF7*{fR-C0h+L?K$X9vEpB$W;$Fu(?&yV?d?Wg50G{|5`u872S#
literal 0
HcmV?d00001
diff --git a/Plugins/Wox.Plugin.Sys/Main.cs b/Plugins/Wox.Plugin.Sys/Main.cs
index e888dbb37..f6be3a435 100644
--- a/Plugins/Wox.Plugin.Sys/Main.cs
+++ b/Plugins/Wox.Plugin.Sys/Main.cs
@@ -234,6 +234,20 @@ namespace Wox.Plugin.Sys
context.API.GetTranslation("wox_plugin_sys_dlgtext_all_applicableplugins_reloaded"));
return true;
}
+ },
+ new Result
+ {
+ Title = "Check For Update",
+ SubTitle = "Check for new Wox update",
+ IcoPath = "Images\\checkupdate.png",
+ Action = c =>
+ {
+ Application.Current.MainWindow.Hide();
+ context.API.CheckForNewUpdate();
+ context.API.ShowMsg("Please wait...",
+ "Checking for new update");
+ return true;
+ }
}
});
return results;
diff --git a/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj b/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj
index 09a1e761f..ffdfa5972 100644
--- a/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj
+++ b/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj
@@ -71,9 +71,15 @@
+
+ PreserveNewest
+
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
diff --git a/Wox.Core/Updater.cs b/Wox.Core/Updater.cs
index 971995f5e..9262d78f4 100644
--- a/Wox.Core/Updater.cs
+++ b/Wox.Core/Updater.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
@@ -10,9 +10,11 @@ using JetBrains.Annotations;
using Squirrel;
using Newtonsoft.Json;
using Wox.Core.Resource;
+using Wox.Plugin.SharedCommands;
using Wox.Infrastructure;
using Wox.Infrastructure.Http;
using Wox.Infrastructure.Logger;
+using System.IO;
namespace Wox.Core
{
@@ -25,14 +27,14 @@ namespace Wox.Core
GitHubRepository = gitHubRepository;
}
- public async Task UpdateApp()
+ public async Task UpdateApp(bool silentIfLatestVersion = true)
{
- UpdateManager m;
- UpdateInfo u;
+ UpdateManager updateManager;
+ UpdateInfo newUpdateInfo;
try
{
- m = await GitHubUpdateManager(GitHubRepository);
+ updateManager = await GitHubUpdateManager(GitHubRepository);
}
catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
{
@@ -43,42 +45,61 @@ namespace Wox.Core
try
{
// UpdateApp CheckForUpdate will return value only if the app is squirrel installed
- u = await m.CheckForUpdate().NonNull();
+ newUpdateInfo = await updateManager.CheckForUpdate().NonNull();
}
catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
{
Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to api.github.com.", e);
- m.Dispose();
+ updateManager.Dispose();
return;
}
- var fr = u.FutureReleaseEntry;
- var cr = u.CurrentlyInstalledVersion;
- Log.Info($"|Updater.UpdateApp|Future Release <{fr.Formatted()}>");
- if (fr.Version > cr.Version)
+ var newReleaseVersion = Version.Parse(newUpdateInfo.FutureReleaseEntry.Version.ToString());
+ var currentVersion = Version.Parse(Constant.Version);
+
+ Log.Info($"|Updater.UpdateApp|Future Release <{newUpdateInfo.FutureReleaseEntry.Formatted()}>");
+
+ if (newReleaseVersion <= currentVersion)
{
- try
- {
- await m.DownloadReleases(u.ReleasesToApply);
- }
- catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
- {
- Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e);
- m.Dispose();
- return;
- }
-
- await m.ApplyReleases(u);
- await m.CreateUninstallerRegistryEntry();
-
- var newVersionTips = this.NewVersinoTips(fr.Version.ToString());
-
- MessageBox.Show(newVersionTips);
- Log.Info($"|Updater.UpdateApp|Update success:{newVersionTips}");
+ if (!silentIfLatestVersion)
+ MessageBox.Show("You already have the latest Wox version");
+ updateManager.Dispose();
+ return;
}
+ try
+ {
+ await updateManager.DownloadReleases(newUpdateInfo.ReleasesToApply);
+ }
+ catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException)
+ {
+ Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e);
+ updateManager.Dispose();
+ return;
+ }
+
+ await updateManager.ApplyReleases(newUpdateInfo);
+
+ if (Constant.IsPortableMode)
+ {
+ var targetDestination = updateManager.RootAppDirectory + $"\\app-{newReleaseVersion.ToString()}\\{Constant.PortableFolderName}";
+ FilesFolders.Copy(Constant.PortableDataPath, targetDestination);
+ if (!FilesFolders.VerifyBothFolderFilesEqual(Constant.PortableDataPath, targetDestination))
+ MessageBox.Show(string.Format("Wox was not able to move your user profile data to the new update version. Please manually" +
+ "move your profile data folder from {0} to {1}", Constant.PortableDataPath, targetDestination));
+ }
+ else
+ {
+ await updateManager.CreateUninstallerRegistryEntry();
+ }
+
+ var newVersionTips = NewVersinoTips(newReleaseVersion.ToString());
+
+ MessageBox.Show(newVersionTips);
+ Log.Info($"|Updater.UpdateApp|Update success:{newVersionTips}");
+
// always dispose UpdateManager
- m.Dispose();
+ updateManager.Dispose();
}
[UsedImplicitly]
diff --git a/Wox.Infrastructure/Wox.cs b/Wox.Infrastructure/Wox.cs
index 396ee0bb1..d09e7b904 100644
--- a/Wox.Infrastructure/Wox.cs
+++ b/Wox.Infrastructure/Wox.cs
@@ -7,12 +7,22 @@ namespace Wox.Infrastructure
{
public static class Constant
{
+ public const string Wox = "Wox";
+ public const string Plugins = "Plugins";
+
+ private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
+ public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
+ public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");
+
+ public static bool IsPortableMode;
+ public const string PortableFolderName = "UserData";
+ public static string PortableDataPath = Path.Combine(ProgramDirectory, PortableFolderName);
public static string DetermineDataDirectory()
{
- string portableDataPath = Path.Combine(ProgramDirectory, "UserData");
- if (Directory.Exists(portableDataPath))
+ if (Directory.Exists(PortableDataPath))
{
- return portableDataPath;
+ IsPortableMode = true;
+ return PortableDataPath;
}
else
{
@@ -20,12 +30,6 @@ namespace Wox.Infrastructure
}
}
- public const string Wox = "Wox";
- public const string Plugins = "Plugins";
-
- private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
- public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
- public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");
public static readonly string DataDirectory = DetermineDataDirectory();
public static readonly string PluginsDirectory = Path.Combine(DataDirectory, Plugins);
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
diff --git a/Wox.Plugin/IPublicAPI.cs b/Wox.Plugin/IPublicAPI.cs
index 8dc838963..754b76d36 100644
--- a/Wox.Plugin/IPublicAPI.cs
+++ b/Wox.Plugin/IPublicAPI.cs
@@ -70,6 +70,11 @@ namespace Wox.Plugin
///