Skip to content

Refactor GenericProfileInstaller into a simple wrapper for PackageInstaller calls#2121

Merged
anttimaki merged 3 commits intodevelopfrom
IRPI-05
Apr 15, 2026
Merged

Refactor GenericProfileInstaller into a simple wrapper for PackageInstaller calls#2121
anttimaki merged 3 commits intodevelopfrom
IRPI-05

Conversation

@anttimaki
Copy link
Copy Markdown
Collaborator

No description provided.

@anttimaki anttimaki requested a review from ebkr April 12, 2026 13:27
Comment thread src/r2mm/installing/profile_installers/GenericProfileInstaller.ts Outdated
All PackageInstaller implementations, for both mod loaders and plugins,
now implement the method so it can be required to ensure future
implementations don't skip it.

Disable/Enable methods are implemented for all plugin installers as
well, but the operation is not supported for mod loader packages, so
the methods remain optional in the interface.
- Define InstallRulePluginInstaller as the PackageInstaller in registry
  for all games that don't use custom one
- GenericProfileInstaller becomes a simple wrapper for calling
  PackageInstaller methods
- By default InstallRulePluginInstaller no longer takes the rules as a
  constuctor argument, but reads them from Thunderstore ecosystem
  schema instead. This allows initiating the installer in registry
  before the active game is selected
  - Rules can still be passed as arguments to constructor, in which
    case those rules are used instead. This is used by
    ReturnOfModdingPluginInstaller and can be used for testing
    purposes as well
- Installer: use the InstallRulePluginInstaller directly rather than
  awkwardly access it through GenericProfileInstaller
- Shimloader: set install rules used in the tests directly as
  InstallRulePluginInstaller args rather than accessing them through
  InstallationRules.RULES
- MelonLoader: ensure active game is set before
  GenericProfileInstaller is initiated, as it now depends on active
  game internally

Current intallation logic tests in the codebase were written when game
specific installation rules were hard coded in the code base and the
implemenation of GenericProfileInstaller contained convoluted
installation logic. Now the installation rules are loaded from
Thunderstore ecosystem schema and installation logic is encapsulated
in PackageLoader implementations. The tests should be reworked so we
have separate test for the GenericProfileInstaller and
PackageInstallers. Game specific test cases should be repThe scope of
such changes require separate PR.
comprehensive test suite for InstallRulePluginInstaller.
@anttimaki anttimaki changed the base branch from IRPI-04 to develop April 15, 2026 06:18
@anttimaki anttimaki merged commit e63ce3e into develop Apr 15, 2026
11 checks passed
@anttimaki anttimaki deleted the IRPI-05 branch April 15, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants