Exemplo n.º 1
0
        private void UpdateAurora()
        {
            var dialog = MessageBox.Show($"Aurora v{_auroraVersionRegistry.AuroraVersions.Max()?.Version} is available. Download now? This is safe and won't affect your existing games.", "Download new Aurora version", MessageBoxButtons.YesNo);

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

            try
            {
                var thread = new Thread(() =>
                {
                    var aurora_files = Installer.GetLatestAuroraFiles();
                    var clean        = new AuroraInstallation(_auroraVersionRegistry.CurrentAuroraVersion, Path.Combine(Program.AuroraLoaderExecutableDirectory, "Clean"));
                    clean.UpdateAurora(aurora_files);
                });
                thread.Start();

                var progress = new FormProgress(thread)
                {
                    Text = "Updating Aurora"
                };
                progress.ShowDialog();
                RefreshAuroraInstallData();
                MessageBox.Show($"Update complete - you can now start new games using Aurora {_auroraVersionRegistry.CurrentAuroraVersion.Version}!");
            }
            catch (Exception ecp)
            {
                Log.Error("Failed to update Aurora", ecp);
                Program.OpenBrowser(@"http://aurora2.pentarch.org/index.php?board=276.0");
            }
        }
Exemplo n.º 2
0
        private void ButtonManageSaves_Click(object sender, EventArgs e)
        {
            if (_saveManagementWindow != null)
            {
                _saveManagementWindow.Close();
            }
            _saveManagementWindow = new FormSaves(auroraInstallation);
            _saveManagementWindow.ShowDialog();

            var name = _saveManagementWindow.SelectedGameName;

            if (name != null)
            {
                var exe      = Path.Combine(Program.AuroraLoaderExecutableDirectory, "Games", name, "Aurora.exe");
                var bytes    = File.ReadAllBytes(exe);
                var checksum = Program.GetChecksum(bytes);
                var version  = _auroraVersionRegistry.AuroraVersions.First(v => v.Checksum == checksum);
                auroraInstallation = new AuroraInstallation(version, Path.GetDirectoryName(exe));

                UpdateListViews();
                RefreshAuroraInstallData();

                SelectedSavelabel.Text     = $"Game: {name} (Aurora v{auroraInstallation.InstalledVersion.Version})";
                ButtonSinglePlayer.Enabled = true;
            }
            else
            {
                SelectedSavelabel.Text     = "No game selected";
                ButtonSinglePlayer.Enabled = false;
            }
        }
Exemplo n.º 3
0
        private void UpdateAurora()
        {
            try
            {
                var thread = new Thread(() =>
                {
                    var aurora_files = Installer.GetLatestAuroraFiles();
                    var clean        = new AuroraInstallation(_auroraVersionRegistry.CurrentAuroraVersion, Path.Combine(Program.AuroraLoaderExecutableDirectory, "Clean"));
                    clean.UpdateAurora(aurora_files);
                });
                thread.Start();

                var progress = new FormProgress(thread)
                {
                    Text = "Updating Aurora"
                };
                progress.ShowDialog();
                RefreshAuroraInstallData();
            }
            catch (Exception ecp)
            {
                Log.Error("Failed to update Aurora", ecp);
                Program.OpenBrowser(@"http://aurora2.pentarch.org/index.php?board=276.0");
            }
        }
Exemplo n.º 4
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;
        }
Exemplo n.º 5
0
 public FormSaves(AuroraInstallation auroraInstallation)
 {
     InitializeComponent();
     _auroraInstallation = auroraInstallation;
 }