protected function finaliseInstall()
{
$update = Table::getInstance('update');
$uid = $update->find(array('element' => $this->element, 'type' => $this->extension->type, 'client_id' => 1));
if ($uid) {
$update->delete($uid);
}
if ($this->route !== 'discover_install') {
if (!$this->parent->copyManifest()) {
throw new \RuntimeException(Text::sprintf('JLIB_INSTALLER_ABORT_COPY_SETUP', Text::_('JLIB_INSTALLER_' . strtoupper($this->route))));
}
}
if (!$this->_buildAdminMenus($this->extension->extension_id)) {
Log::add(Text::_('JLIB_INSTALLER_ABORT_COMP_BUILDADMINMENUS_FAILED'), Log::WARNING, 'jerror');
}
if (!$this->_updateMenus($this->extension->extension_id)) {
Log::add(Text::_('JLIB_INSTALLER_ABORT_COMP_UPDATESITEMENUS_FAILED'), Log::WARNING, 'jerror');
}
$asset = Table::getInstance('Asset');
if (!$asset->loadByName($this->extension->element)) {
$asset->name = $this->extension->element;
$asset->parent_id = 1;
$asset->rules = '{}';
$asset->title = $this->extension->name;
$asset->setLocation(1, 'last-child');
if (!$asset->store()) {
throw new \RuntimeException(Text::sprintf('JLIB_INSTALLER_ABORT_ROLLBACK', Text::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->extension->getError()));
}
}
}