Conversation
This is a step on the path to make InstallRulePluginInstaller support all four methods of PackageInstaller class. I'm not sure if it matters in which order uninstallState and uninstallModLoader is called but decide to keep the order unchanged. Likewise uninstallModLoader behaves the same way it used to, i.e. even if mod loader files are uninstalled, the rest of the non-loader mod uninstallation code is still executed.
Some extra logic is still left in GenericProfileInstaller - these can be cleaned out once getPluginInstaller starts returning IRPI as the installer for the games that currently fall back to legacy implementation that's embedded into GenericProfileInstaller.
Both ReturnOfModdingInstaller and ReturnOfModdingPluginInstaller have independent implementations for uninstalling and related packages never call uninstallSubDir.
Mainly rename the variable that refers to BepInEx when other mod loaders also use this code path.
Import it into package loader installers that don't have a custom implementation. Now all package loader installers implement uninstall, but this doesn't apply to plugin installers yet. It's worth noting that this duplicates the implementation, as the package loader uninstall logic is still kept in GenericProfileInstaller too, since the version extracted to PackageInstaller handles errors slightly differently. The verison in GenericProfileInstaller will be removed later as the refactoring process progresses.
ebkr
approved these changes
Apr 8, 2026
Comment on lines
+151
to
+154
| // Fallback to legacy uninstallation. | ||
| throwForR2Error(await this.uninstallModLoader(mod, profile)); | ||
| const args = this.getInstallArgs(mod, profile); | ||
| await this.legacyInstaller.uninstall(args); |
Owner
There was a problem hiding this comment.
What do we not cover with these changes? Why the need for the fallback?
Collaborator
Author
There was a problem hiding this comment.
This is just a move-code-around refactoring commit, so to keep the mod manager behaving like it did before the commit, I don't remove the legacy fallback here. (TBH I don't remember if there's actually some use cases that actually still hit this code path at this point.) It will be removed in an upcoming PR once all the logic has been moved from GenericProfileInstaller to PackageInstaller implementations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.