diff --git a/Main.cs b/Main.cs index ed86faf..a54b757 100644 --- a/Main.cs +++ b/Main.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation +// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -65,8 +65,6 @@ public partial class Main : IPlugin, IPluginI18n, IContextMenu, ISettingProvider // constructor public Main() { - GetPackages(); - LoadInstalledList(); } private static void LoadInstalledList() @@ -102,7 +100,7 @@ public class WingetPackage public string Version { get; set; } } - private static async void GetPackages() + private static async Task GetPackagesAsync() { // Download packages list var packages = new List(); @@ -199,6 +197,9 @@ public void Init(PluginInitContext context) $"Plugin: {Properties.Resources.plugin_name}", errorMsgString); }; + + GetPackagesAsync().Wait(); + LoadInstalledList(); } public static void Winget(string cmd)