Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanly switch versions of installed mod #2669

Merged
merged 1 commit into from
Feb 1, 2019

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Jan 27, 2019

Problem

GUI lets you install an old version of a mod by double clicking in the Versions tab of mod info.

If another version of the mod is already installed, then the progress screen will appear and announce that the mod is being skipped because it's already installed. This means that to switch to a different version of an installed mod, you have to uninstall it explicitly and then install the other version. If other mods depend on it, they will be uninstalled, and you have to remember to re-install them afterwards.

This was a pain point recently with ModuleManager 4.0.0, which apparently broke loading of "custom tech tree and physics". Impatient users who upgraded to this version and didn't want to wait for a fix (4.0.1 came out ~26 hours later) were stuck either with a broken install or with uninstalling many mods, rolling back MM, and then re-installing everything.

Changes

If a mod to be installed is already installed, Main.InstallModuleDriver will add a ModChange to the change set to uninstall the installed version first.

ModChange.GetHashCode is updated to consider installing a mod and removing it to be different concepts (previously it only considered the mod's identifier, so if you tried to add an Install and Remove step for the same mod to a HashSet, the second one would be discarded).

You can tell ModuleInstaller.UninstallList that you're planning to install mods later via a new installing parameter. The mods in this list will not have their reverse dependencies uninstalled, and if this list is passed, then consistency will not be enforced on the assumption that a later installation step needs to be completed first. Main.InstallMods passes its mods-to-install in this parameter.

MainModList.ComputeChangeSetFromModList is updated similarly; mods to be both removed and installed will no longer have their reverse dependencies removed.

ModChange.ToString is created to ease debugging.
GUIMod.ToString is created to ease debugging.

After all of these changes, you can install a bunch of mods depending on ModuleManager, then replace ModuleManager with a different version, and everything will work out.

(This will probably conflict with #2660. I'll resolve that if/when we get to that point.)

@HebaruSan HebaruSan added Enhancement New features or functionality GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN Pull request Relationships Issues affecting depends, recommends, etc. labels Jan 27, 2019
@politas
Copy link
Member

politas commented Jan 30, 2019

This looks useful for #2671 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality GUI Issues affecting the interactive GUI Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants