예제 #1
0
        private async Task <bool> InitializePlugins()
        {
            if (!Settings.ValidateAll())
            {
                return(false);
            }

            await Async.Run(() =>
            {
                IoC.Notif.ShowStatus("Removing old version...");
                //remove failed / old patches
                Compatibility.CleanupOldVersions();
                FileBackup.CleanupBackups(Configs.PatchPath);
            });

            IoC.Notif.ShowStatus("Initializing Plugins...");
            foreach (var module in Plugins)
            {
                await module.Initialize();
            }

            _initialized = true;

            if (File.Exists(Configs.PatchPath))
            {
                await LoadExistingPack(Configs.PatchPath, true);
            }

            return(true);
        }