Пример #1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            try
            {
                Icon = new Icon(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Aurora.ico"));
            }
            catch
            {
                Log.Debug("Failed to load icon");
            }

            _ = MessageBox.Show(new Form {
                TopMost = true
            }, "AuroraLoader will check for updates and then launch, this might take a moment.");
            Cursor = Cursors.WaitCursor;

            CheckEnableMods.Enabled          = true;
            ComboSelectExecutableMod.Enabled = false;
            ListDatabaseMods.Enabled         = false;
            CheckEnablePoweruserMods.Enabled = false;
            ButtonMultiplayer.Enabled        = false;

            // Only check mirrors for new versions at app startup
            _auroraVersionRegistry.Update(_modRegistry.Mirrors);
            auroraInstallation = new AuroraInstallation(_auroraVersionRegistry.CurrentAuroraVersion, Path.Combine(Program.AuroraLoaderExecutableDirectory, "Clean"));

            _modRegistry.Update(_auroraVersionRegistry.CurrentAuroraVersion, true);
            RefreshAuroraInstallData();
            UpdateListViews();

            Cursor = Cursors.Default;
        }
Пример #2
0
        /// <summary>
        /// Sets current install's version and checksum, and whether the update button is enabled
        /// </summary>
        private void RefreshAuroraInstallData()
        {
            _auroraVersionRegistry.Update();
            if (_auroraVersionRegistry.CurrentAuroraVersion == null)
            {
                LabelVersion.Text = "Aurora version: Unknown";
            }
            else
            {
                LabelChecksum.Text            = $"Aurora checksum: {_auroraVersionRegistry.CurrentAuroraVersion.Checksum}";
                LabelVersion.Text             = $"Aurora version: {_auroraVersionRegistry.CurrentAuroraVersion.Version}";
                LabelAuroraLoaderVersion.Text = $"AuroraLoader Version: {_modRegistry.Mods.Single(m => m.Name == "AuroraLoader").Installation.Version}";

                if (_auroraVersionRegistry.CurrentAuroraVersion.Version.CompareTo(_auroraVersionRegistry.AuroraVersions.Max().Version) < 0)
                {
                    ButtonUpdateAurora.Text      = $"Update Aurora to {_auroraVersionRegistry.AuroraVersions.Max().Version}";
                    ButtonUpdateAurora.ForeColor = Color.Green;
                    ButtonUpdateAurora.Enabled   = true;
                }
                else
                {
                    ButtonUpdateAurora.Text      = "Aurora is up to date";
                    ButtonUpdateAurora.ForeColor = Color.Black;
                    ButtonUpdateAurora.Enabled   = false;
                }
            }

            try
            {
                var auroraLoaderMod = _modRegistry.Mods.Single(mod => mod.Name == "AuroraLoader");
                if (auroraLoaderMod.CanBeUpdated)
                {
                    ButtonUpdateAuroraLoader.Text      = $"Update AuroraLoader to {auroraLoaderMod.Listing.LatestVersion}";
                    ButtonUpdateAuroraLoader.ForeColor = Color.Green;
                    ButtonUpdateAuroraLoader.Enabled   = true;
                }
                else
                {
                    ButtonUpdateAuroraLoader.Text      = "AuroraLoader is up to date";
                    ButtonUpdateAuroraLoader.ForeColor = Color.Black;
                    ButtonUpdateAuroraLoader.Enabled   = false;
                }
            }
            catch (Exception exc)
            {
                Log.Error("Unable to check AuroraLoader updates", exc);
            }
        }
Пример #3
0
 private void FormModDownload_Load(object sender, EventArgs e)
 {
     _auroraVersionRegistry.Update(_modRegistry.Mirrors);
     _modRegistry.Update(_auroraVersionRegistry.CurrentAuroraVersion, true);
     UpdateManageModsListView();
 }