예제 #1
0
 /// <summary>
 /// Sets some UI text to indicate that the addon loader is having an update check
 /// </summary>
 /// <param name="aViewModel"></param>
 public LoaderSetup(UpdatingViewModel aViewModel)
 {
     viewModel        = aViewModel;
     viewModel.label  = "Checking for updates to Addon Loader";
     userConfig       = Configuration.getConfigAsYAML();
     loader_game_path = Path.Combine(userConfig.game_path, userConfig.bin_folder);
 }
예제 #2
0
 /// <summary>
 /// Constructor; also sets some UI text to indicate that the addon loader is having an update check
 /// </summary>
 public LoaderSetup(IConfigurationManager configurationManager)
 {
     _configurationManager  = configurationManager;
     viewModel              = UpdatingViewModel.GetInstance;
     viewModel.ProgBarLabel = "Checking for updates to Addon Loader";
     loader_game_path       = Path.Combine(configurationManager.UserConfig.GamePath, configurationManager.UserConfig.BinFolder);
 }
예제 #3
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;
        }
예제 #4
0
 /// <summary>
 /// The constructor sets the label to a placeholder value and disables the "finish" button.
 /// </summary>
 private UpdatingViewModel()
 {
     onlyInstance    = this;
     ProgBarLabel    = "Updating Add-Ons";
     CloseBtnEnabled = false;
     BackBtnEnabled  = false;
 }
예제 #5
0
 /// <summary>
 /// Constructor; also sets some UI text to indicate that the addon loader is having an update check
 /// </summary>
 public LoaderSetup()
 {
     viewModel = UpdatingViewModel.GetInstance;
     viewModel.ProgBarLabel = "Checking for updates to Addon Loader";
     userConfig             = Configuration.getConfigAsYAML();
     loader_game_path       = Path.Combine(userConfig.game_path, userConfig.bin_folder);
 }
        public GenericUpdater(AddonInfoFromYaml addon)
        {
            addon_name = addon.folder_name;
            addon_info = addon;
            viewModel  = UpdatingViewModel.GetInstance;
            userConfig = Configuration.getConfigAsYAML();

            addon_expanded_path = Path.Combine(Path.GetTempPath(), addon_name);
            addon_install_path  = Path.Combine(Configuration.getConfigAsYAML().game_path, "addons\\");
        }
예제 #7
0
        public GenericUpdater(AddonInfoFromYaml addon, IConfigurationManager configurationManager)
        {
            addon_name            = addon.folder_name;
            addon_info            = addon;
            _configurationManager = configurationManager;
            viewModel             = UpdatingViewModel.GetInstance;

            addon_expanded_path = Path.Combine(Path.GetTempPath(), addon_name);
            addon_install_path  = Path.Combine(configurationManager.UserConfig.GamePath, "addons\\");
        }
예제 #8
0
        /// <summary>
        /// Sets the page's DataContext, initializes it, and begins the update process.
        /// </summary>
        public UpdatingView()
        {
            theViewModel = new UpdatingViewModel();
            DataContext  = theViewModel;
            InitializeComponent();

            LoaderSetup settingUp = new LoaderSetup(theViewModel);

            Task.Run(() => UpdateHelpers.UpdateAll(theViewModel));
        }
예제 #9
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;
        }
예제 #10
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;
        }
예제 #11
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);

                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;
        }