private void _bepInstallButton_Click(object sender, EventArgs e) { this._bepInstallButton.Enabled = false; this._uninstallButton.Enabled = false; MefinoGUI.SetProgressBarActive(true); BepInExHandler.UpdateBepInEx(); // update GUI before moving on this._bepInstallButton.Enabled = true; this._uninstallButton.Enabled = true; MefinoGUI.SetProgressBarActive(false); RefreshBepInExPanel(); Application.DoEvents(); if (BepInExHandler.s_lastInstallStateResult != InstallState.Installed) { MessageBox.Show($"Failed to update BepInEx! Make sure Outward isn't running and you're online.", "Warning", MessageBoxButtons.OK); } else { ProfileManager.LoadProfiles(false); } }
internal static void Cmd_BepInEx(params string[] args) { if (!Folders.IsCurrentOutwardPathValid()) { Console.WriteLine("You need to set the Outward path first!"); return; } BepInExHandler.UpdateBepInExIfNeeded(); }
internal void RefreshBepInExPanel() { if (!Folders.IsCurrentOutwardPathValid()) { this._bepPanel.Visible = false; this._uninstallButton.Visible = false; MefinoGUI.DisableFeaturePages(); return; } this._bepPanel.Visible = true; if (BepInExHandler.IsBepInExUpdated()) { this._bepStatus.Text = "Installed"; this._bepStatus.ForeColor = Color.LightGreen; this._bepInstallButton.Visible = false; LocalPackageManager.RefreshInstalledPackages(); MefinoGUI.EnabledFeaturePages(); Folders.CheckOutwardMefinoInstall(); this._uninstallButton.Visible = true; } else { this._uninstallButton.Visible = false; MefinoGUI.DisableFeaturePages(); switch (BepInExHandler.s_lastInstallStateResult) { case InstallState.Outdated: this._bepStatus.Text = $"Outdated"; this._bepStatus.ForeColor = Color.DarkKhaki; this._bepInstallButton.Visible = true; this._bepInstallButton.Text = $"Update to {BepInExHandler.s_latestBepInExVersion}"; break; case InstallState.NotInstalled: this._bepStatus.Text = "Not installed"; this._bepStatus.ForeColor = Color.IndianRed; this._bepInstallButton.Visible = true; this._bepInstallButton.Text = $"Install BepInEx {BepInExHandler.s_latestBepInExVersion}"; break; } } }