From a6d1df89be01eb22601dfc884a5a637e62a2bab2 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Fri, 24 Apr 2020 21:28:13 +0800 Subject: [PATCH 1/6] list all artifacts --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 44bfdce48..da9cc0644 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,6 +14,7 @@ build: project: Wox.sln after_test: - ps: Copy-Item $env:APPDATA\Wox\Logs\*\*.txt . +- ps: ls artifacts: - path: 'Output\Packages\Wox-*.zip' name: installer From d9c769cb7d63ddb251acff03b7e734a9969d42b7 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Fri, 24 Apr 2020 21:31:22 +0800 Subject: [PATCH 2/6] fixup appveyor log --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index da9cc0644..123586133 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ build: project: Wox.sln after_test: - ps: Copy-Item $env:APPDATA\Wox\Logs\*\*.txt . -- ps: ls +- ps: ls Output\Packages artifacts: - path: 'Output\Packages\Wox-*.zip' name: installer From 01c88243decd1a8e44220d11ecf8886f3412f427 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Fri, 24 Apr 2020 21:42:04 +0800 Subject: [PATCH 3/6] fix appveyor build --- Scripts/wox.nuspec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Scripts/wox.nuspec b/Scripts/wox.nuspec index afb179039..e409cbdcf 100644 --- a/Scripts/wox.nuspec +++ b/Scripts/wox.nuspec @@ -6,11 +6,13 @@ $version$ Wox https://github.com/Wox-launcher/Wox - Images/app.png false Wox - a launcher for windows + + + - + From 7ee1faaec08ee9a6b3e213f373e4033d6672672e Mon Sep 17 00:00:00 2001 From: bao-qian Date: Fri, 24 Apr 2020 21:48:42 +0800 Subject: [PATCH 4/6] fix wox.plugin nuspec warning --- Scripts/wox.plugin.nuspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/wox.plugin.nuspec b/Scripts/wox.plugin.nuspec index 2dc3d283a..ca448efd1 100644 --- a/Scripts/wox.plugin.nuspec +++ b/Scripts/wox.plugin.nuspec @@ -4,11 +4,13 @@ Wox.Plugin $version$ Wox - https://github.com/Wox-launcher/Wox/blob/master/LICENSE https://github.com/Wox-launcher/Wox false Reference this library if you want to develop a wox plugin wox + + + From 5d5fac9279cdb65d3ade2b9eee9974890961efb5 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Fri, 24 Apr 2020 22:13:24 +0800 Subject: [PATCH 5/6] remove unused exception warning --- Plugins/Wox.Plugin.BrowserBookmark/Main.cs | 2 +- .../Wox.Plugin.Folder/ContextMenuLoader.cs | 2 +- Plugins/Wox.Plugin.Program/Programs/Win32.cs | 2 +- Plugins/Wox.Plugin.Shell/Main.cs | 2 +- Plugins/Wox.Plugin.Url/Main.cs | 4 +- Plugins/Wox.Plugin.WebSearch/Main.cs | 2 +- Wox.Core/Configuration/Portable.cs | 1 - Wox.Core/Updater.cs | 2 +- .../FilesFolders.cs | 47 +++++++++---------- Wox.Infrastructure/Wox.Infrastructure.csproj | 1 + Wox.Plugin/SharedCommands/SearchWeb.cs | 2 +- Wox.Plugin/SharedCommands/ShellCommand.cs | 2 +- Wox.Plugin/Wox.Plugin.csproj | 4 +- 13 files changed, 35 insertions(+), 38 deletions(-) rename {Wox.Plugin/SharedCommands => Wox.Infrastructure}/FilesFolders.cs (74%) diff --git a/Plugins/Wox.Plugin.BrowserBookmark/Main.cs b/Plugins/Wox.Plugin.BrowserBookmark/Main.cs index a616edce0..b07191584 100644 --- a/Plugins/Wox.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Wox.Plugin.BrowserBookmark/Main.cs @@ -5,7 +5,7 @@ using Wox.Plugin.BrowserBookmark.Commands; using Wox.Plugin.BrowserBookmark.Models; using Wox.Plugin.BrowserBookmark.Views; -using Wox.Plugin.SharedCommands; +using Wox.Infrastructure; namespace Wox.Plugin.BrowserBookmark { diff --git a/Plugins/Wox.Plugin.Folder/ContextMenuLoader.cs b/Plugins/Wox.Plugin.Folder/ContextMenuLoader.cs index 616a4d0ed..edd0fd8df 100644 --- a/Plugins/Wox.Plugin.Folder/ContextMenuLoader.cs +++ b/Plugins/Wox.Plugin.Folder/ContextMenuLoader.cs @@ -7,7 +7,7 @@ using NLog; using Wox.Infrastructure.Logger; using Wox.Infrastructure.Image; -using Wox.Plugin.SharedCommands; +using Wox.Infrastructure; namespace Wox.Plugin.Folder { diff --git a/Plugins/Wox.Plugin.Program/Programs/Win32.cs b/Plugins/Wox.Plugin.Program/Programs/Win32.cs index c52720b8c..0b9f8777a 100644 --- a/Plugins/Wox.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Wox.Plugin.Program/Programs/Win32.cs @@ -13,7 +13,7 @@ using Wox.Infrastructure; using Wox.Infrastructure.Logger; using Wox.Plugin.Program.Logger; -using Wox.Plugin.SharedCommands; +using Wox.Infrastructure; namespace Wox.Plugin.Program.Programs { diff --git a/Plugins/Wox.Plugin.Shell/Main.cs b/Plugins/Wox.Plugin.Shell/Main.cs index f62059b39..09285a6a5 100644 --- a/Plugins/Wox.Plugin.Shell/Main.cs +++ b/Plugins/Wox.Plugin.Shell/Main.cs @@ -12,7 +12,7 @@ using Wox.Infrastructure.Hotkey; using Wox.Infrastructure.Logger; using Wox.Infrastructure.Storage; -using Wox.Plugin.SharedCommands; +using Wox.Infrastructure; using Application = System.Windows.Application; using Control = System.Windows.Controls.Control; using Keys = System.Windows.Forms.Keys; diff --git a/Plugins/Wox.Plugin.Url/Main.cs b/Plugins/Wox.Plugin.Url/Main.cs index ed4e55b86..da50d5dab 100644 --- a/Plugins/Wox.Plugin.Url/Main.cs +++ b/Plugins/Wox.Plugin.Url/Main.cs @@ -3,7 +3,7 @@ using System.Text.RegularExpressions; using System.Windows.Controls; using Wox.Infrastructure.Storage; -using Wox.Plugin.SharedCommands; +using Wox.Infrastructure; namespace Wox.Plugin.Url { @@ -90,7 +90,7 @@ public List Query(Query query) return true; } - catch(Exception ex) + catch(Exception) { context.API.ShowMsg(string.Format(context.API.GetTranslation("wox_plugin_url_canot_open_url"), raw)); return false; diff --git a/Plugins/Wox.Plugin.WebSearch/Main.cs b/Plugins/Wox.Plugin.WebSearch/Main.cs index d8c6ccafb..44f5b17ad 100644 --- a/Plugins/Wox.Plugin.WebSearch/Main.cs +++ b/Plugins/Wox.Plugin.WebSearch/Main.cs @@ -8,7 +8,7 @@ using System.Windows.Controls; using Wox.Infrastructure; using Wox.Infrastructure.Storage; -using Wox.Plugin.SharedCommands; +using Wox.Infrastructure; namespace Wox.Plugin.WebSearch { diff --git a/Wox.Core/Configuration/Portable.cs b/Wox.Core/Configuration/Portable.cs index a52ce143b..7dddb843c 100644 --- a/Wox.Core/Configuration/Portable.cs +++ b/Wox.Core/Configuration/Portable.cs @@ -8,7 +8,6 @@ using Wox.Infrastructure; using Wox.Infrastructure.Logger; using Wox.Infrastructure.UserSettings; -using Wox.Plugin.SharedCommands; namespace Wox.Core.Configuration { diff --git a/Wox.Core/Updater.cs b/Wox.Core/Updater.cs index c78e99354..14f8aee6f 100644 --- a/Wox.Core/Updater.cs +++ b/Wox.Core/Updater.cs @@ -10,7 +10,7 @@ using Squirrel; using Newtonsoft.Json; using Wox.Core.Resource; -using Wox.Plugin.SharedCommands; +using Wox.Infrastructure; using Wox.Infrastructure; using Wox.Infrastructure.Http; using Wox.Infrastructure.Logger; diff --git a/Wox.Plugin/SharedCommands/FilesFolders.cs b/Wox.Infrastructure/FilesFolders.cs similarity index 74% rename from Wox.Plugin/SharedCommands/FilesFolders.cs rename to Wox.Infrastructure/FilesFolders.cs index 9e221fe61..ba54ff70a 100644 --- a/Wox.Plugin/SharedCommands/FilesFolders.cs +++ b/Wox.Infrastructure/FilesFolders.cs @@ -1,12 +1,15 @@ -using System; +using NLog; +using System; using System.Diagnostics; using System.IO; using System.Windows; -namespace Wox.Plugin.SharedCommands +namespace Wox.Infrastructure { public static class FilesFolders { + private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); + public static void Copy(this string sourcePath, string targetPath) { // Get the subdirectories for the specified directory. @@ -43,14 +46,12 @@ public static void Copy(this string sourcePath, string targetPath) Copy(subdir.FullName, temppath); } } - catch (Exception e) + catch (System.Exception e) { -#if DEBUG - throw e; -#else - MessageBox.Show(string.Format("Copying path {0} has failed, it will now be deleted for consistency", targetPath)); + string message = $"Copying path {targetPath} has failed, it will now be deleted for consistency"; + Logger.Error(e, message); + MessageBox.Show(message); RemoveFolderIfExists(targetPath); -#endif } } @@ -70,14 +71,12 @@ public static bool VerifyBothFolderFilesEqual(this string fromPath, string toPat return true; } - catch (Exception e) + catch (System.Exception e) { -#if DEBUG - throw e; -#else - MessageBox.Show(string.Format("Unable to verify folders and files between {0} and {1}", fromPath, toPath)); + string message = $"Unable to verify folders and files between {fromPath} and {toPath}"; + Logger.Error(e, message); + MessageBox.Show(message); return false; -#endif } } @@ -89,13 +88,11 @@ public static void RemoveFolderIfExists(this string path) if (Directory.Exists(path)) Directory.Delete(path, true); } - catch (Exception e) + catch (System.Exception e) { -#if DEBUG - throw e; -#else - MessageBox.Show(string.Format("Not able to delete folder {0}, please go to the location and manually delete it", path)); -#endif + string message = $"Not able to delete folder { (object)path}, please go to the location and manually delete it"; + Logger.Error(e, message); + MessageBox.Show(message); } } @@ -116,13 +113,11 @@ public static void OpenLocationInExporer(string location) if (LocationExists(location)) Process.Start(location); } - catch (Exception e) + catch (System.Exception e) { -#if DEBUG - throw e; -#else - MessageBox.Show(string.Format("Unable to open location {0}, please check if it exists", location)); -#endif + string message = $"Unable to open location { (object)location}, please check if it exists"; + Logger.Error(e, message); + MessageBox.Show(message); } } } diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index 2545ffbbc..53728d8a2 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -51,6 +51,7 @@ Properties\SolutionAssemblyInfo.cs + diff --git a/Wox.Plugin/SharedCommands/SearchWeb.cs b/Wox.Plugin/SharedCommands/SearchWeb.cs index f91025bff..8ae431fa8 100644 --- a/Wox.Plugin/SharedCommands/SearchWeb.cs +++ b/Wox.Plugin/SharedCommands/SearchWeb.cs @@ -3,7 +3,7 @@ using System.IO; using System.Linq; -namespace Wox.Plugin.SharedCommands +namespace Wox.Infrastructure { public static class SearchWeb { diff --git a/Wox.Plugin/SharedCommands/ShellCommand.cs b/Wox.Plugin/SharedCommands/ShellCommand.cs index 9da535150..b3fb4bf92 100644 --- a/Wox.Plugin/SharedCommands/ShellCommand.cs +++ b/Wox.Plugin/SharedCommands/ShellCommand.cs @@ -7,7 +7,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Wox.Plugin.SharedCommands +namespace Wox.Infrastructure { public static class ShellCommand { diff --git a/Wox.Plugin/Wox.Plugin.csproj b/Wox.Plugin/Wox.Plugin.csproj index aaa868f2e..80104547c 100644 --- a/Wox.Plugin/Wox.Plugin.csproj +++ b/Wox.Plugin/Wox.Plugin.csproj @@ -65,7 +65,6 @@ - @@ -90,6 +89,9 @@ 9.0.1 + + 4.7.0 + 3.2.8 runtime; build; native; contentfiles; analyzers; buildtransitive From d9a1824e71eaf012ce36f20ea7631c262fb8e440 Mon Sep 17 00:00:00 2001 From: bao-qian Date: Fri, 24 Apr 2020 22:16:47 +0800 Subject: [PATCH 6/6] fixup --- Plugins/Wox.Plugin.Program/Programs/Win32.cs | 1 - Plugins/Wox.Plugin.WebSearch/Main.cs | 1 - Wox.Core/Plugin/QueryBuilder.cs | 1 + Wox.Core/Updater.cs | 1 - Wox.Infrastructure/FilesFolders.cs | 9 +++++---- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Plugins/Wox.Plugin.Program/Programs/Win32.cs b/Plugins/Wox.Plugin.Program/Programs/Win32.cs index 0b9f8777a..b0a6c01ed 100644 --- a/Plugins/Wox.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Wox.Plugin.Program/Programs/Win32.cs @@ -13,7 +13,6 @@ using Wox.Infrastructure; using Wox.Infrastructure.Logger; using Wox.Plugin.Program.Logger; -using Wox.Infrastructure; namespace Wox.Plugin.Program.Programs { diff --git a/Plugins/Wox.Plugin.WebSearch/Main.cs b/Plugins/Wox.Plugin.WebSearch/Main.cs index 44f5b17ad..24c657e64 100644 --- a/Plugins/Wox.Plugin.WebSearch/Main.cs +++ b/Plugins/Wox.Plugin.WebSearch/Main.cs @@ -8,7 +8,6 @@ using System.Windows.Controls; using Wox.Infrastructure; using Wox.Infrastructure.Storage; -using Wox.Infrastructure; namespace Wox.Plugin.WebSearch { diff --git a/Wox.Core/Plugin/QueryBuilder.cs b/Wox.Core/Plugin/QueryBuilder.cs index b01a93291..e70331669 100644 --- a/Wox.Core/Plugin/QueryBuilder.cs +++ b/Wox.Core/Plugin/QueryBuilder.cs @@ -35,6 +35,7 @@ public static Query Build(string text, Dictionary nonGlobalP var query = new Query { + Terms = terms, RawQuery = rawQuery, ActionKeyword = actionKeyword, diff --git a/Wox.Core/Updater.cs b/Wox.Core/Updater.cs index 14f8aee6f..e948db1e2 100644 --- a/Wox.Core/Updater.cs +++ b/Wox.Core/Updater.cs @@ -11,7 +11,6 @@ using Newtonsoft.Json; using Wox.Core.Resource; using Wox.Infrastructure; -using Wox.Infrastructure; using Wox.Infrastructure.Http; using Wox.Infrastructure.Logger; using System.IO; diff --git a/Wox.Infrastructure/FilesFolders.cs b/Wox.Infrastructure/FilesFolders.cs index ba54ff70a..7207d8efb 100644 --- a/Wox.Infrastructure/FilesFolders.cs +++ b/Wox.Infrastructure/FilesFolders.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.IO; using System.Windows; +using Wox.Infrastructure.Logger; namespace Wox.Infrastructure { @@ -49,7 +50,7 @@ public static void Copy(this string sourcePath, string targetPath) catch (System.Exception e) { string message = $"Copying path {targetPath} has failed, it will now be deleted for consistency"; - Logger.Error(e, message); + Logger.WoxError(message, e); MessageBox.Show(message); RemoveFolderIfExists(targetPath); } @@ -74,7 +75,7 @@ public static bool VerifyBothFolderFilesEqual(this string fromPath, string toPat catch (System.Exception e) { string message = $"Unable to verify folders and files between {fromPath} and {toPath}"; - Logger.Error(e, message); + Logger.WoxError(message, e); MessageBox.Show(message); return false; } @@ -91,7 +92,7 @@ public static void RemoveFolderIfExists(this string path) catch (System.Exception e) { string message = $"Not able to delete folder { (object)path}, please go to the location and manually delete it"; - Logger.Error(e, message); + Logger.WoxError(message, e); MessageBox.Show(message); } } @@ -116,7 +117,7 @@ public static void OpenLocationInExporer(string location) catch (System.Exception e) { string message = $"Unable to open location { (object)location}, please check if it exists"; - Logger.Error(e, message); + Logger.WoxError(message, e); MessageBox.Show(message); } }