Пример #1
0
        public static async void UpdateAll()
        {
            UpdatingViewModel viewModel = UpdatingViewModel.GetInstance;

            LoaderSetup settingUp = new LoaderSetup(new ConfigurationManager());
            await settingUp.HandleLoaderUpdate();

            List <AddonInfoFromYaml> addons = (List <AddonInfoFromYaml>)Application.Current.Properties["Selected"];

            var configurationManager = new ConfigurationManager();

            foreach (AddonInfoFromYaml addon in addons.Where(add => add != null))
            {
                GenericUpdater updater = new GenericUpdater(addon, configurationManager);

                if (!(addon.additional_flags != null && addon.additional_flags.Contains("self-updating") &&
                      configurationManager.UserConfig.AddonsList.FirstOrDefault(a => a.Name == addon.addon_name)?.Installed == true))
                {
                    await updater.Update();
                }
            }

            viewModel.ProgBarLabel     = "Updates Complete";
            viewModel.DownloadProgress = 100;
            viewModel.CloseBtnEnabled  = true;
            viewModel.BackBtnEnabled   = true;
        }
Пример #2
0
        public static async void UpdateAll(UpdatingViewModel viewModel)
        {
            LoaderSetup settingUp = new LoaderSetup(viewModel);
            await settingUp.handleLoaderInstall();

            List <AddonInfo> addons = (List <AddonInfo>)Application.Current.Properties["Selected"];

            foreach (AddonInfo addon in addons.Where(add => add != null))
            {
                GenericUpdater updater = new GenericUpdater(addon, viewModel);
                await updater.Update();
            }

            viewModel.label              = "Updates Complete";
            viewModel.showProgress       = 100;
            viewModel.closeButtonEnabled = true;
        }
Пример #3
0
        public static async void UpdateAll()
        {
            UpdatingViewModel viewModel = UpdatingViewModel.GetInstance;

            LoaderSetup settingUp = new LoaderSetup();
            await settingUp.HandleLoaderUpdate();

            List <AddonInfoFromYaml> addons = (List <AddonInfoFromYaml>)Application.Current.Properties["Selected"];

            foreach (AddonInfoFromYaml addon in addons.Where(add => add != null))
            {
                GenericUpdater updater = new GenericUpdater(addon);
                await updater.Update();
            }

            viewModel.ProgBarLabel     = "Updates Complete";
            viewModel.DownloadProgress = 100;
            viewModel.CloseBtnEnabled  = true;
        }
        public static async void UpdateAll()
        {
            UpdatingViewModel viewModel = UpdatingViewModel.GetInstance;

            LoaderSetup settingUp = new LoaderSetup();
            await settingUp.HandleLoaderUpdate();

            List <AddonInfoFromYaml> addons = (List <AddonInfoFromYaml>)Application.Current.Properties["Selected"];

            foreach (AddonInfoFromYaml addon in addons.Where(add => add != null))
            {
                GenericUpdater updater = new GenericUpdater(addon);

                if (!(addon.additional_flags != null && addon.additional_flags.Contains("self-updating") && Configuration.getConfigAsYAML().installed.ContainsKey(addon.folder_name)))
                {
                    await updater.Update();
                }
            }

            viewModel.ProgBarLabel     = "Updates Complete";
            viewModel.DownloadProgress = 100;
            viewModel.CloseBtnEnabled  = true;
            viewModel.BackBtnEnabled   = true;
        }