From e2fa9683b93aca33b2517d4a55335510cc9da5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Tue, 23 Feb 2021 09:36:37 +0800 Subject: [PATCH 01/13] change taskcanceledexception to operationcanceledexception --- Flow.Launcher.Core/Updater.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs index 8f0de798c..9f9c0c2d1 100644 --- a/Flow.Launcher.Core/Updater.cs +++ b/Flow.Launcher.Core/Updater.cs @@ -87,7 +87,7 @@ namespace Flow.Launcher.Core UpdateManager.RestartApp(Constant.ApplicationFileName); } } - catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException || e is TaskCanceledException) + catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException || e is OperationCanceledException) { Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e); api.ShowMsg(api.GetTranslation("update_flowlauncher_fail"), From b07b1ddb311e57ad034eace2d12bc08fc52600d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Tue, 23 Feb 2021 09:53:17 +0800 Subject: [PATCH 02/13] Change TaskCanceledException in WebSearch plugin to operationCanceledException --- Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs | 3 +-- .../SuggestionSources/Baidu.cs | 2 +- .../SuggestionSources/Bing.cs | 2 +- .../SuggestionSources/Google.cs | 6 +++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs index 4135bb59a..7eca5a568 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs @@ -125,8 +125,7 @@ namespace Flow.Launcher.Plugin.WebSearch { var suggestions = await source.Suggestions(keyword, token).ConfigureAwait(false); - if (token.IsCancellationRequested) - return null; + token.ThrowIfCancellationRequested(); var resultsFromSuggestion = suggestions?.Select(o => new Result { diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs index 385a9f8b5..38a589797 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs @@ -25,7 +25,7 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources const string api = "http://suggestion.baidu.com/su?json=1&wd="; result = await Http.GetAsync(api + Uri.EscapeUriString(query), token).ConfigureAwait(false); } - catch (TaskCanceledException) + catch (OperationCanceledException) { return null; } diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs index e505d78cf..10de86820 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs @@ -28,7 +28,7 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources json = (await JsonDocument.ParseAsync(resultStream, cancellationToken: token)).RootElement.GetProperty("AS"); } - catch (TaskCanceledException) + catch (OperationCanceledException) { return new List(); } diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs index c075f4d5d..5f1ecb31b 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs @@ -23,11 +23,11 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources const string api = "https://www.google.com/complete/search?output=chrome&q="; using var resultStream = await Http.GetStreamAsync(api + Uri.EscapeUriString(query)).ConfigureAwait(false); - - json = await JsonDocument.ParseAsync(resultStream); + + json = await JsonDocument.ParseAsync(resultStream, cancellationToken: token); } - catch (TaskCanceledException) + catch (OperationCanceledException) { return new List(); } From d81a4a7fa382f7c30fadf5180cf391cae6db8a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 24 Feb 2021 12:37:57 +0800 Subject: [PATCH 03/13] avoid dupplicate assembly load --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 273698b86..c806f68bd 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -21,7 +21,7 @@ namespace Flow.Launcher.Core.Plugin assemblyName = new AssemblyName(Path.GetFileNameWithoutExtension(assemblyFilePath)); referencedPluginPackageDependencyResolver = - new AssemblyDependencyResolver(Path.Combine(Constant.ProgramDirectory, "Flow.Launcher.Plugin.dll")); + new AssemblyDependencyResolver(Path.Combine(Constant.ProgramDirectory, "Flow.Launcher.dll")); } internal Assembly LoadAssemblyAndDependencies() From 6804b93a8ddc2a90eaceeea2af3b6b652f6b36ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 24 Feb 2021 12:42:13 +0800 Subject: [PATCH 04/13] remove comment regarding newtonsoft.json --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index c806f68bd..1924c5a91 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -33,9 +33,6 @@ namespace Flow.Launcher.Core.Plugin { string assemblyPath = dependencyResolver.ResolveAssemblyToPath(assemblyName); - // When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher.Plugin - // Otherwise will get unexpected behaviour with plugins, e.g. JsonIgnore attribute not honored in WebSearch or other plugins - // that use Newtonsoft.Json if (assemblyPath == null || ExistsInReferencedPluginPackage(assemblyName)) return null; From d161faebbb89c42fd2f51b8f0694595aab2ce966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 24 Feb 2021 12:44:42 +0800 Subject: [PATCH 05/13] make referencedPluginPackageDependencyResolver static --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 1924c5a91..06f6eb22e 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -11,17 +11,22 @@ namespace Flow.Launcher.Core.Plugin { private readonly AssemblyDependencyResolver dependencyResolver; - private readonly AssemblyDependencyResolver referencedPluginPackageDependencyResolver; + private static readonly AssemblyDependencyResolver referencedPluginPackageDependencyResolver; private readonly AssemblyName assemblyName; + static PluginAssemblyLoader() + { + referencedPluginPackageDependencyResolver = + new AssemblyDependencyResolver(Path.Combine(Constant.ProgramDirectory, "Flow.Launcher.dll")); + } + internal PluginAssemblyLoader(string assemblyFilePath) { dependencyResolver = new AssemblyDependencyResolver(assemblyFilePath); assemblyName = new AssemblyName(Path.GetFileNameWithoutExtension(assemblyFilePath)); - referencedPluginPackageDependencyResolver = - new AssemblyDependencyResolver(Path.Combine(Constant.ProgramDirectory, "Flow.Launcher.dll")); + } internal Assembly LoadAssemblyAndDependencies() From 0b51a8c467ba20328e6e4c48d46f74d73ecba373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 24 Feb 2021 12:46:51 +0800 Subject: [PATCH 06/13] rename method --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 06f6eb22e..90363073b 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -38,7 +38,7 @@ namespace Flow.Launcher.Core.Plugin { string assemblyPath = dependencyResolver.ResolveAssemblyToPath(assemblyName); - if (assemblyPath == null || ExistsInReferencedPluginPackage(assemblyName)) + if (assemblyPath == null || ExistsInReferencedPackage(assemblyName)) return null; return LoadFromAssemblyPath(assemblyPath); @@ -51,7 +51,7 @@ namespace Flow.Launcher.Core.Plugin return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Intersect(types).Any()); } - internal bool ExistsInReferencedPluginPackage(AssemblyName assemblyName) + internal bool ExistsInReferencedPackage(AssemblyName assemblyName) { return referencedPluginPackageDependencyResolver.ResolveAssemblyToPath(assemblyName) != null; } From 7739ac73fdd33f16a92f28f5251daace0640e056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 24 Feb 2021 15:55:03 +0800 Subject: [PATCH 07/13] change exception handling in Updater and WebSearch suggestion source --- Flow.Launcher.Core/Updater.cs | 2 +- .../SuggestionSources/Baidu.cs | 13 +++++++------ .../SuggestionSources/Bing.cs | 10 +++++----- .../SuggestionSources/Google.cs | 10 +++++----- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs index 9f9c0c2d1..76713ce2a 100644 --- a/Flow.Launcher.Core/Updater.cs +++ b/Flow.Launcher.Core/Updater.cs @@ -87,7 +87,7 @@ namespace Flow.Launcher.Core UpdateManager.RestartApp(Constant.ApplicationFileName); } } - catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException || e is OperationCanceledException) + catch (Exception e) when (e is HttpRequestException || e is WebException || e is SocketException || e.InnerException is TimeoutException) { Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e); api.ShowMsg(api.GetTranslation("update_flowlauncher_fail"), diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs index 38a589797..94458ff52 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Baidu.cs @@ -25,15 +25,16 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources const string api = "http://suggestion.baidu.com/su?json=1&wd="; result = await Http.GetAsync(api + Uri.EscapeUriString(query), token).ConfigureAwait(false); } - catch (OperationCanceledException) - { - return null; - } - catch (HttpRequestException e) + catch (Exception e) when (e is HttpRequestException || e.InnerException is TimeoutException) { Log.Exception("|Baidu.Suggestions|Can't get suggestion from baidu", e); return null; } + catch (OperationCanceledException) + { + return null; + } + if (string.IsNullOrEmpty(result)) return new List(); Match match = _reg.Match(result); @@ -44,7 +45,7 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources { json = JsonDocument.Parse(match.Groups[1].Value); } - catch(JsonException e) + catch (JsonException e) { Log.Exception("|Baidu.Suggestions|can't parse suggestions", e); return new List(); diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs index 10de86820..28868100f 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Bing.cs @@ -28,15 +28,15 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources json = (await JsonDocument.ParseAsync(resultStream, cancellationToken: token)).RootElement.GetProperty("AS"); } + catch (Exception e) when (e is HttpRequestException || e.InnerException is TimeoutException) + { + Log.Exception("|Baidu.Suggestions|Can't get suggestion from baidu", e); + return null; + } catch (OperationCanceledException) { return new List(); } - catch (HttpRequestException e) - { - Log.Exception("|Bing.Suggestions|Can't get suggestion from Bing", e); - return new List(); - } catch (JsonException e) { Log.Exception("|Bing.Suggestions|can't parse suggestions", e); diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs index 5f1ecb31b..a06deea29 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/SuggestionSources/Google.cs @@ -27,15 +27,15 @@ namespace Flow.Launcher.Plugin.WebSearch.SuggestionSources json = await JsonDocument.ParseAsync(resultStream, cancellationToken: token); } + catch (Exception e) when (e is HttpRequestException || e.InnerException is TimeoutException) + { + Log.Exception("|Baidu.Suggestions|Can't get suggestion from baidu", e); + return null; + } catch (OperationCanceledException) { return new List(); } - catch (HttpRequestException e) - { - Log.Exception("|Google.Suggestions|Can't get suggestion from google", e); - return new List(); - } catch (JsonException e) { Log.Exception("|Google.Suggestions|can't parse suggestions", e); From 03df6e458532c3dff31b3615b7c10ac128c9c2c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 24 Feb 2021 18:49:01 +0800 Subject: [PATCH 08/13] add comment back and remove extra empty line --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 90363073b..0284afe5b 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -38,6 +38,10 @@ namespace Flow.Launcher.Core.Plugin { string assemblyPath = dependencyResolver.ResolveAssemblyToPath(assemblyName); + // When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher + // Otherwise duplicate assembly will be loaded, and some weird behavior will occur such as WinRT.dll + // will fail to create + if (assemblyPath == null || ExistsInReferencedPackage(assemblyName)) return null; From 9e343ebff47c78a4f078ac3bcbb92a0d4a8d580f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 24 Feb 2021 18:51:44 +0800 Subject: [PATCH 09/13] remove extra line --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 0284afe5b..91fc90964 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -25,8 +25,6 @@ namespace Flow.Launcher.Core.Plugin { dependencyResolver = new AssemblyDependencyResolver(assemblyFilePath); assemblyName = new AssemblyName(Path.GetFileNameWithoutExtension(assemblyFilePath)); - - } internal Assembly LoadAssemblyAndDependencies() @@ -60,4 +58,4 @@ namespace Flow.Launcher.Core.Plugin return referencedPluginPackageDependencyResolver.ResolveAssemblyToPath(assemblyName) != null; } } -} +} \ No newline at end of file From 84257aa5d9727cae8935631cf661ff7f74e031cc Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Wed, 24 Feb 2021 21:57:18 +1100 Subject: [PATCH 10/13] update PluginAssemblyLoader comment --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 91fc90964..22e3cc51a 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -36,10 +36,10 @@ namespace Flow.Launcher.Core.Plugin { string assemblyPath = dependencyResolver.ResolveAssemblyToPath(assemblyName); - // When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher - // Otherwise duplicate assembly will be loaded, and some weird behavior will occur such as WinRT.dll - // will fail to create - + // When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher. + // Otherwise duplicate assembly will be loaded and some weird behavior will occur, such as WinRT.Runtime.dll + // will fail due to loading multiple versions in process, each with their own static instance of registration state + if (assemblyPath == null || ExistsInReferencedPackage(assemblyName)) return null; From 81926c04cd709d25dbacd234c19548d588358350 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Wed, 24 Feb 2021 22:01:11 +1100 Subject: [PATCH 11/13] remove extra space --- Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 22e3cc51a..4ac4b2551 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -36,10 +36,9 @@ namespace Flow.Launcher.Core.Plugin { string assemblyPath = dependencyResolver.ResolveAssemblyToPath(assemblyName); - // When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher. + // When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher // Otherwise duplicate assembly will be loaded and some weird behavior will occur, such as WinRT.Runtime.dll - // will fail due to loading multiple versions in process, each with their own static instance of registration state - + // will fail due to loading multiple versions in process, each with their own static instance of registration state if (assemblyPath == null || ExistsInReferencedPackage(assemblyName)) return null; From a4b7bc522174aa6373ed2cef832525cee1ba8a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 24 Feb 2021 20:36:32 +0800 Subject: [PATCH 12/13] Use AppDomain to retrive the assembly that has been loaded, which contains the version --- .../Plugin/PluginAssemblyLoader.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs index 91fc90964..e1c6d6d5a 100644 --- a/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs @@ -1,5 +1,6 @@ using Flow.Launcher.Infrastructure; using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; @@ -11,14 +12,17 @@ namespace Flow.Launcher.Core.Plugin { private readonly AssemblyDependencyResolver dependencyResolver; - private static readonly AssemblyDependencyResolver referencedPluginPackageDependencyResolver; - private readonly AssemblyName assemblyName; + private static readonly List loadedAssembly; + static PluginAssemblyLoader() { - referencedPluginPackageDependencyResolver = - new AssemblyDependencyResolver(Path.Combine(Constant.ProgramDirectory, "Flow.Launcher.dll")); + loadedAssembly = new List(AppDomain.CurrentDomain.GetAssemblies()); + AppDomain.CurrentDomain.AssemblyLoad += (sender, args) => + { + loadedAssembly.Add(args.LoadedAssembly); + }; } internal PluginAssemblyLoader(string assemblyFilePath) @@ -39,7 +43,7 @@ namespace Flow.Launcher.Core.Plugin // When resolving dependencies, ignore assembly depenedencies that already exits with Flow.Launcher // Otherwise duplicate assembly will be loaded, and some weird behavior will occur such as WinRT.dll // will fail to create - + if (assemblyPath == null || ExistsInReferencedPackage(assemblyName)) return null; @@ -49,13 +53,14 @@ namespace Flow.Launcher.Core.Plugin internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, params Type[] types) { var allTypes = assembly.ExportedTypes; - return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Intersect(types).Any()); } internal bool ExistsInReferencedPackage(AssemblyName assemblyName) { - return referencedPluginPackageDependencyResolver.ResolveAssemblyToPath(assemblyName) != null; + if (loadedAssembly.Any(a => a.FullName == assemblyName.FullName)) + return true; + return false; } } } \ No newline at end of file From 3a45c99c2916be4edb89f723c7e3ad56f1517e86 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 25 Feb 2021 13:59:29 +1100 Subject: [PATCH 13/13] version bump WebSearch plugin --- Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json index 6e9986749..996c9b686 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json @@ -25,7 +25,7 @@ "Name": "Web Searches", "Description": "Provide the web search ability", "Author": "qianlifeng", - "Version": "1.3.2", + "Version": "1.3.3", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.WebSearch.dll",