IPluginInstaller

class mobase.IPluginInstaller

Bases: IPlugin

This is the top-level class for installer. Actual installers should inherit either:

  • IPluginInstallerSimple if the installer can work directly with the archive. This is what most installers use.

  • IPluginInstallerCustom if the installer needs to perform custom operations. This is only used by the external NCC installer and the OMOD installer.

Methods Summary

isArchiveSupported(tree)

Check if the given file tree corresponds to a supported archive for this installer.

isManualInstaller()

Check if this installer is a manual installer.

onInstallationEnd(result, new_mod)

Method calls at the end of the installation process.

onInstallationStart(archive, reinstallation, ...)

Method calls at the start of the installation process, before any other methods.

priority()

Retrieve the priority of this installer.

setInstallationManager(manager)

Set the installation manager for this installer.

setParentWidget(parent)

Set the parent widget for this installer.

Methods Documentation

abstract isArchiveSupported(tree)

Check if the given file tree corresponds to a supported archive for this installer.

Return type:

bool

Parameters:

tree – The tree representing the content of the archive.

Returns:

True if this installer can handle the archive, False otherwise.

abstract isManualInstaller()

Check if this installer is a manual installer.

Return type:

bool

Returns:

True if this installer is a manual installer, False otherwise.

onInstallationEnd(result, new_mod)

Method calls at the end of the installation process. This method is only called once per installation process, even for recursive installations (e.g. with the bundle installer).

Return type:

None

Parameters:
  • result – The result of the installation.

  • new_mod – If the installation succeeded (result is RESULT_SUCCESS), contains the newly installed mod, otherwise it contains a null pointer.

onInstallationStart(archive, reinstallation, current_mod)

Method calls at the start of the installation process, before any other methods. This method is only called once per installation process, even for recursive installations (e.g. with the bundle installer).

If reinstallation is true, then the given mod is the mod being reinstalled (the one selected by the user). If reinstallation is false and currentMod is not null, then it corresponds to a mod MO2 thinks corresponds to the archive (e.g. based on matching Nexus ID or name).

The default implementation does nothing.

Return type:

None

Parameters:
  • archive – Path to the archive that is going to be installed.

  • reinstallation – True if this is a reinstallation, False otherwise.

  • current_mod – A currently installed mod corresponding to the archive being installed, or None if there is no such mod.

abstract priority()

Retrieve the priority of this installer.

If multiple installers are able to handle an archive, the one with the highest priority wins.

Return type:

int

Returns:

The priority of this installer.

setInstallationManager(manager)

Set the installation manager for this installer.

Python plugins usually do not need to re-implement this and can directly access the installation manager using _manager().

Return type:

None

Parameters:

manager – The installation manager.

setParentWidget(parent)

Set the parent widget for this installer.

Python plugins usually do not need to re-implement this and can directly access the parent widget using _parentWidget() once the UI has been initialized.

Return type:

None

Parameters:

parent – The parent widget.