class Setup extends XF\AddOn\AbstractSetup
{
public function checkRequirements(&$errors = [], &$warnings = [])
{
$addOn = $this->app->em()->find('XF:AddOn', 'OldAddOnId');
if ($addOn)
{
$errors[] = 'Please uninstall "Old Add-on" before continuing with the installation.';
}
}
// other setup methods
}