IPluginInstaller

class mobase.IPluginInstaller

Bases: mobase.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.

Parameters

tree – The tree representing the content of the archive.

Returns

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

Return type

bool

abstract isManualInstaller()

Check if this installer is a manual installer.

Returns

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

Return type

bool

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).

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.

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.

Returns

The priority of this installer.

Return type

int

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().

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.

Parameters

parent – The parent widget.