internal static void Cmd_RefreshModList(params string[] args) { if (!Folders.IsCurrentOutwardPathValid()) { Console.WriteLine("You need to set the Outward path first!"); return; } WebManifestManager.UpdateWebManifests(); LocalPackageManager.RefreshInstalledPackages(); }
/// <summary> /// Refresh all packages, online and local. Optionally re-download new manifests as well, if <paramref name="refreshOnline"/> is <see langword="true"/> /// </summary> public static void RefreshAllPackages(bool refreshOnline = false) { if (refreshOnline) { WebManifestManager.UpdateWebManifests(); } else { WebManifestManager.LoadWebManifestCache(); } // refresh installed packages LocalPackageManager.RefreshInstalledPackages(); }
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; } } }
private void _uninstallButton_Click(object sender, EventArgs e) { ProfileManager.SavePrompt(false); var result = OutwardHelper.UninstallFromOutward(); if (result == DialogResult.Cancel) { return; } Folders.IsCurrentOutwardPathValid(out InstallState state); SetOtwPathResult(state); LocalPackageManager.RefreshInstalledPackages(); LauncherPage.Instance.RebuildPackageList(); }
private static void OnFileSystemChanged(object sender, FileSystemEventArgs e) { if (IOHelper.MefinoDoingIO) { return; } // Console.WriteLine("Manual folder IO detected"); LocalPackageManager.RefreshInstalledPackages(); if (ProfileManager.IsProfileDifferentToEnabledPackages()) { ProfileManager.SetChangesSinceSave(true); } LauncherPage.Instance?.Invoke(new MethodInvoker(LauncherPage.Instance.RebuildPackageList)); }