private void DownloadWorker_DoWork_1(object sender, DoWorkEventArgs e) //When installwindow is activated { CurrentWorker.Text = "Base Skin"; List <bool> InstallerArguments = e.Argument as List <bool>; DownloadOfficial(InstallActions.GetLatestMetro()); if (InstallActions.err_ARCHIVE) { page1.Visible = true; InstallerPage.Visible = false; return; } InstallActions.InstallSkin(SteamSkinPath); installProgress.Value += 5; if (InstallerArguments[0]) { CurrentWorker.Text = "Unofficial Patch"; InstallActions.InstallPatch(SteamSkinPath); installProgress.Value += 25; InstallExtras(); } CurrentWorker.Text = "Cleaning Up"; InstallActions.Cleanup(); installProgress.Value = 100; CurrentWorker.Text = "Finished"; button1.Enabled = true; button1.ForeColor = Color.White; button1.Image = Properties.Resources.close_button; }
private void DownloadPatch_DoWork(object sender, DoWorkEventArgs e) //When select extras window is activated { DownloadPatch(); if (DownloadPatchWorker.CancellationPending) { InstallActions.Cleanup(); return; } progressBar1.Value = 100; InstallActions.ZipProgressChanged += (f) => { progressBar1.Value = f; }; InstallActions.TempExtractPatch(); InstallActions.ZipProgressChanged -= (f) => { progressBar1.Value = f; }; if (!DownloadPatchWorker.CancellationPending) { if (InstallActions.err_ARCHIVE) { page1.Visible = true; page2patched.Visible = false; return; } extrasListBox.DataSource = InstallActions.DetectExtras(); if (File.Exists(SteamSkinPath + InstallActions.SkinFolder + "\\extras.txt")) { string[] savedExtras = File.ReadAllLines(SteamSkinPath + InstallActions.SkinFolder + "\\extras.txt"); for (int i = 0; i < extrasListBox.Items.Count; i++) { if (savedExtras.Contains(extrasListBox.Items[i])) { extrasListBox.SetItemChecked(i, true); } } if (savedExtras.Length > 0) { saveExtrasCheckBox.Checked = true; } } progressBar1.Visible = false; extrasLoadingText.Visible = false; saveExtrasCheckBox.Invoke((MethodInvoker)(() => { saveExtrasCheckBox.Visible = true; })); PatchInstallButton.Enabled = true; PatchInstallButton.ForeColor = Color.White; PatchInstallButton.Image = Properties.Resources.right_arrow; } else { InstallActions.Cleanup(); } }
private void ExitButton_Click(object sender, EventArgs e) { InstallActions.Cleanup(); Application.Exit(); }