diff --git a/Flow.Launcher.Core/Plugin/JsonPRCModel.cs b/Flow.Launcher.Core/Plugin/JsonPRCModel.cs index 9bc7c2472cb..247fe1889d6 100644 --- a/Flow.Launcher.Core/Plugin/JsonPRCModel.cs +++ b/Flow.Launcher.Core/Plugin/JsonPRCModel.cs @@ -15,6 +15,7 @@ using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using Flow.Launcher.Plugin; namespace Flow.Launcher.Core.Plugin @@ -42,6 +43,7 @@ public class JsonRPCResponseModel : JsonRPCModelBase public class JsonRPCQueryResponseModel : JsonRPCResponseModel { + [JsonPropertyName("result")] public new List Result { get; set; } } diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs index 3d4522498d9..c7ad70391b7 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs @@ -147,47 +147,42 @@ protected string Execute(ProcessStartInfo startInfo) { try { - using (var process = Process.Start(startInfo)) + using var process = Process.Start(startInfo); + if (process == null) { - if (process != null) + Log.Error("|JsonRPCPlugin.Execute|Can't start new process"); + return string.Empty; + } + + using var standardOutput = process.StandardOutput; + var result = standardOutput.ReadToEnd(); + if (string.IsNullOrEmpty(result)) + { + using (var standardError = process.StandardError) { - using (var standardOutput = process.StandardOutput) + var error = standardError.ReadToEnd(); + if (!string.IsNullOrEmpty(error)) { - var result = standardOutput.ReadToEnd(); - if (string.IsNullOrEmpty(result)) - { - using (var standardError = process.StandardError) - { - var error = standardError.ReadToEnd(); - if (!string.IsNullOrEmpty(error)) - { - Log.Error($"|JsonRPCPlugin.Execute|{error}"); - return string.Empty; - } - else - { - Log.Error("|JsonRPCPlugin.Execute|Empty standard output and standard error."); - return string.Empty; - } - } - } - else if (result.StartsWith("DEBUG:")) - { - MessageBox.Show(new Form { TopMost = true }, result.Substring(6)); - return string.Empty; - } - else - { - return result; - } + Log.Error($"|JsonRPCPlugin.Execute|{error}"); + return string.Empty; + } + else + { + Log.Error("|JsonRPCPlugin.Execute|Empty standard output and standard error."); + return string.Empty; } - } - else - { - Log.Error("|JsonRPCPlugin.Execute|Can't start new process"); - return string.Empty; } } + else if (result.StartsWith("DEBUG:")) + { + MessageBox.Show(new Form { TopMost = true }, result.Substring(6)); + return string.Empty; + } + else + { + return result; + } + } catch (Exception e) { diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 26167e945ac..700a7d509e2 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -183,6 +183,8 @@ public static async Task> QueryForPlugin(PluginPair pair, Query que throw new ArgumentOutOfRangeException(); } token.ThrowIfCancellationRequested(); + if (results == null) + return results; UpdatePluginMetadata(results, metadata, query); metadata.QueryCount += 1; diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 289a502d0f7..20e847f8267 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -66,6 +66,9 @@ PreserveNewest + + PreserveNewest + diff --git a/Flow.Launcher/Images/app.ico b/Flow.Launcher/Images/app.ico new file mode 100644 index 00000000000..36b1d22d0b3 Binary files /dev/null and b/Flow.Launcher/Images/app.ico differ diff --git a/Flow.Launcher/Languages/sk.xaml b/Flow.Launcher/Languages/sk.xaml index 64230a93aba..7f1b1739daa 100644 --- a/Flow.Launcher/Languages/sk.xaml +++ b/Flow.Launcher/Languages/sk.xaml @@ -40,8 +40,8 @@ Plugin Nájsť ďalšie pluginy - Povoliť - Zakázať + Povolené + Zakázané Skratka akcie Aktuálna akcia skratky: Nová akcia skratky: diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 427fd9fc639..0afa67d1a97 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -61,6 +61,9 @@ public void RestartApp() // which will cause ungraceful exit SaveAppAllSettings(); + // Restart requires Squirrel's Update.exe to be present in the parent folder, + // it is only published from the project's release pipeline. When debugging without it, + // the project may not restart or just terminates. This is expected. UpdateManager.RestartApp(Constant.ApplicationFileName); } diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 4c7eac114dd..cb0ef2defa1 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -11,7 +11,7 @@ xmlns:svgc="http://sharpvectors.codeplex.com/svgc/" x:Class="Flow.Launcher.SettingWindow" mc:Ignorable="d" - Icon="Images\app.png" + Icon="Images\app.ico" Title="{DynamicResource flowlauncher_settings}" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 05dbb3a8b8b..afbe6e19758 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -363,7 +363,7 @@ private void QueryContextMenu() } if (!match.IsSearchPrecisionScoreMet()) return false; - + r.Score = match.Score; return true; @@ -512,7 +512,7 @@ async Task QueryTask(PluginPair plugin) await Task.Yield(); var results = await PluginManager.QueryForPlugin(plugin, query, currentCancellationToken); - if (!currentCancellationToken.IsCancellationRequested) + if (!currentCancellationToken.IsCancellationRequested && results != null) _resultsUpdateQueue.Post(new ResultsForUpdate(results, plugin.Metadata, query, currentCancellationToken)); } diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml index c08f0265c05..b0d84f45dc2 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml @@ -6,7 +6,7 @@ Spracúva matematické operácie.(Skúste 5*3-2 vo flowlauncheri) Nie je číslo (NaN) Nesprávny alebo neúplný výraz (Nezabudli ste na zátvorky?) - Kopírovať toto číslo do schránky + Kopírovať výsledok do schránky Oddeľovač des. miest Oddeľovač desatinných miest použitý vo výsledku. Použiť podľa systému diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 600b573cfe5..6872f04b445 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -1,10 +1,8 @@ using Flow.Launcher.Infrastructure; using Flow.Launcher.Plugin.SharedCommands; using System; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Runtime.CompilerServices; using System.Windows; namespace Flow.Launcher.Plugin.Explorer.Search diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs index 7bc357be421..85f918a0305 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs @@ -25,7 +25,7 @@ public List LoadContextMenus(Result selectedResult) { Title = Context.API.GetTranslation("plugin_pluginsmanager_plugin_contextmenu_openwebsite_title"), SubTitle = Context.API.GetTranslation("plugin_pluginsmanager_plugin_contextmenu_openwebsite_subtitle"), - IcoPath = "Images\\website.png", + IcoPath = selectedResult.IcoPath, Action = _ => { SharedCommands.SearchWeb.NewTabInBrowser(pluginManifestInfo.Website); @@ -63,7 +63,7 @@ public List LoadContextMenus(Result selectedResult) { Title = Context.API.GetTranslation("plugin_pluginsmanager_plugin_contextmenu_pluginsmanifest_title"), SubTitle = Context.API.GetTranslation("plugin_pluginsmanager_plugin_contextmenu_pluginsmanifest_subtitle"), - IcoPath = selectedResult.IcoPath, + IcoPath = "Images\\manifestsite.png", Action = _ => { SharedCommands.SearchWeb.NewTabInBrowser("https://github.com/Flow-Launcher/Flow.Launcher.PluginsManifest"); diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj b/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj index cb2507a2b65..f94027bcccd 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Flow.Launcher.Plugin.PluginsManager.csproj @@ -18,6 +18,7 @@ + diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/website.png b/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/manifestsite.png similarity index 100% rename from Plugins/Flow.Launcher.Plugin.PluginsManager/Images/website.png rename to Plugins/Flow.Launcher.Plugin.PluginsManager/Images/manifestsite.png diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/sk.xaml index 211f2b4308e..fe5afa317c2 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/sk.xaml +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/Languages/sk.xaml @@ -7,7 +7,7 @@ Čakajte, prosím… Úspešne stiahnuté {0} od {1} {2}{3}Chcete odinštalovať tento plugin? Po odinštalovaní sa Flow automaticky reštartuje. - {0} by {1} {2}{3}Chcete nainštalovať tento plugin? Po odinštalovaní sa Flow automaticky reštartuje. + {0} by {1} {2}{3}Chcete nainštalovať tento plugin? Po nainštalovaní sa Flow automaticky reštartuje. Inštalovať plugin Odinštalovať plugin Inštalácia zlyhala: nepodarilo sa nájsť metadáta súboru plugin.json nového pluginu diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 0f5e6d9e8b9..90d103bc712 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -1,8 +1,10 @@ +using Flow.Launcher.Core.Plugin; using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.Http; using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin.PluginsManager.Models; +using Flow.Launcher.Plugin.SharedCommands; using System; using System.Collections.Generic; using System.IO; @@ -327,7 +329,9 @@ private void Install(UserPlugin plugin, string downloadedFilePath) var zipFilePath = Path.Combine(tempFolderPath, Path.GetFileName(downloadedFilePath)); - File.Move(downloadedFilePath, zipFilePath); + File.Copy(downloadedFilePath, zipFilePath); + + File.Delete(downloadedFilePath); Utilities.UnZip(zipFilePath, tempFolderPluginPath, true); @@ -345,7 +349,9 @@ private void Install(UserPlugin plugin, string downloadedFilePath) string newPluginPath = Path.Combine(DataLocation.PluginsDirectory, $"{plugin.Name}-{plugin.Version}"); - Directory.Move(pluginFolderPath, newPluginPath); + FilesFolders.CopyAll(pluginFolderPath, newPluginPath); + + Directory.Delete(pluginFolderPath, true); } internal List RequestUninstall(string search) @@ -395,6 +401,9 @@ internal List RequestUninstall(string search) private void Uninstall(PluginMetadata plugin) { + PluginManager.Settings.Plugins.Remove(plugin.ID); + PluginManager.AllPlugins.RemoveAll(p => p.Metadata.ID == plugin.ID); + // Marked for deletion. Will be deleted on next start up using var _ = File.CreateText(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt")); } diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json index 75d6038d431..4cba7ec83e8 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json @@ -6,7 +6,7 @@ "Name": "Plugins Manager", "Description": "Management of installing, uninstalling or updating Flow Launcher plugins", "Author": "Jeremy Wu", - "Version": "1.6.1", + "Version": "1.6.4", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll", diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sk.xaml index 47644fbe982..851d9f244d5 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sk.xaml +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Languages/sk.xaml @@ -4,7 +4,7 @@ Otvoriť vyhľadávanie v: Nové okno Nová karta - Zadajte cestu k prehliadaču: + Cesta k prehliadaču: Vybrať Odstrániť Upraviť diff --git a/README.md b/README.md index ac861129804..9af47a5ee01 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,12 @@ Flow Launcher. Dedicated to make your workflow flow more seamlessly. Aimed at be - Search everything from applications, files, bookmarks, YouTube, Twitter and more. All from the comfort of your keyboard without ever touching the mouse. - Search for file contents. -- Support search using environment variable paths +- Support search using environment variable paths. - Run batch and PowerShell commands as Administrator or a different user. - Support languages from Chinese to Italian and more. -- Support of wide range of plugins. +- Support wide range of plugins. +- Prioritise the order of each plugin's results. +- Save file or folder locations for quick access. - Fully portable. [ **SOFTPEDIA EDITOR'S PICK**](https://www.softpedia.com/get/System/Launchers-Shutdown-Tools/Flow-Launcher.shtml) @@ -45,13 +47,14 @@ Windows may complain about security due to code not being signed, this will be c **Usage** - Open flow's search window: Alt+Space is the default hotkey. -- Open context menu: Ctrl+O/Shift+Enter. +- Search programs, bookmarks and control panel items with acronyms eg. `gk` or `gp` for GitKraken Preview; fuzzy search eg. `code` or `vis` for Visual Studio Code. +- Open context menu: on the selected result, press Ctrl+O/Shift+Enter. - Cancel/Return to previous screen: Esc. - Install/Uninstall/Update plugins: in the search window, type `pm install`/`pm uninstall`/`pm update` + the plugin name. - Saved user settings are located: - If using roaming: `%APPDATA%\FlowLauncher` - If using portable, by default: `%localappdata%\FlowLauncher\app-\UserData` -- Logs are saved along with your user settings folder +- Logs are saved along with your user settings folder. ## Status diff --git a/SolutionAssemblyInfo.cs b/SolutionAssemblyInfo.cs index afd76b5d7da..7f13f41306a 100644 --- a/SolutionAssemblyInfo.cs +++ b/SolutionAssemblyInfo.cs @@ -16,6 +16,6 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.7.0")] -[assembly: AssemblyFileVersion("1.7.0")] -[assembly: AssemblyInformationalVersion("1.7.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.7.1")] +[assembly: AssemblyFileVersion("1.7.1")] +[assembly: AssemblyInformationalVersion("1.7.1")] \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 2c2f43b66b4..6340318d474 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: '1.7.0.{build}' +version: '1.7.1.{build}' init: - ps: |