Пример #1
0
        private void UpdateLoader()
        {
            var dialog = MessageBox.Show($"AuroraLoader version {_modRegistry.AuroraLoaderMod.LatestVersion.Version} available. Update?", "Update Loader", MessageBoxButtons.YesNo);

            if (dialog != DialogResult.Yes)
            {
                return;
            }

            try
            {
                var thread = new Thread(() => _modRegistry.UpdateAuroraLoader());
                thread.Start();
                var progress = new FormProgress(thread);
                progress.ShowDialog();
                _modRegistry.AuroraLoaderMod.UpdateCache();
                Process.Start(Path.Combine(Program.AuroraLoaderExecutableDirectory, "update_loader.bat"));
                Application.Exit();
                return;
            }
            catch (Exception exc)
            {
                Log.Error("Failed to update AuroraLoader", exc);
                MessageBox.Show("Update failed.");
            }
        }
Пример #2
0
 private void UpdateLoader()
 {
     MessageBox.Show($"Installing AuroraLoader {_modRegistry.AuroraLoaderMod.LatestVersion.Version}");
     try
     {
         var thread = new Thread(() => _modRegistry.UpdateAuroraLoader());
         thread.Start();
         var progress = new FormProgress(thread);
         progress.ShowDialog();
         _modRegistry.AuroraLoaderMod.UpdateCache();
         Process.Start(Path.Combine(Program.AuroraLoaderExecutableDirectory, "update_loader.bat"));
         Application.Exit();
         return;
     }
     catch (Exception exc)
     {
         Log.Error("Failed to update AuroraLoader", exc);
         MessageBox.Show("Update failed.");
     }
 }
Пример #3
0
        private void ButtonUpdateAuroraLoader_Click(object sender, EventArgs e)
        {
            var auroraLoaderMod = _modRegistry.Mods.Single(mod => mod.Name == "AuroraLoader");

            MessageBox.Show($"Installing AuroraLoader {auroraLoaderMod.Listing.LatestVersion}");
            try
            {
                var thread = new Thread(() => _modRegistry.UpdateAuroraLoader(auroraLoaderMod));
                thread.Start();
                var progress = new FormProgress(thread);
                progress.ShowDialog();
                Process.Start("update_loader.bat");
                Application.Exit();
                return;
            }
            catch (Exception exc)
            {
                Log.Error("Failed to update AuroraLoader", exc);
                MessageBox.Show("Update failed.");
            }
        }