preflight() public method

Joomla! pre-flight event. This runs before Joomla! installs or updates the component. This is our last chance to tell Joomla! if it should abort the installation.
public preflight ( string $type, JInstallerAdapterComponent $parent ) : boolean
$type string Installation type (install, update, discover_install)
$parent JInstallerAdapterComponent Parent object
return boolean True to let the installation proceed, false to halt the installation
 /**
  * Joomla! pre-flight event. This runs before Joomla! installs or updates the component. This is our last chance to
  * tell Joomla! if it should abort the installation.
  *
  * @param   string                     $type   Installation type (install, update, discover_install)
  * @param   JInstallerAdapterComponent $parent Parent object
  *
  * @return  boolean  True to let the installation proceed, false to halt the installation
  */
 public function preflight($type, $parent)
 {
     $this->isPaid = is_dir($parent->getParent()->getPath('source') . '/backend/AliceEngine');
     $result = parent::preflight($type, $parent);
     if (!$result) {
         return $result;
     }
     // Move the server key file from /akeeba or /engine to /BackupEngine
     $componentPath = JPATH_ADMINISTRATOR . '/components/com_akeeba';
     $fromFile = $componentPath . '/akeeba/serverkey.php';
     $toFile = $componentPath . '/BackupEngine/serverkey.php';
     if (!file_exists($fromFile)) {
         $fromFile = $componentPath . '/engine/serverkey.php';
     }
     if (@file_exists($fromFile) && !@file_exists($toFile)) {
         $toPath = $componentPath . '/BackupEngine';
         if (class_exists('JLoader') && method_exists('JLoader', 'import')) {
             JLoader::import('joomla.filesystem.folder');
             JLoader::import('joomla.filesystem.file');
         }
         if (@is_dir($componentPath) && !@is_dir($toPath)) {
             JFolder::create($toPath);
         }
         if (@is_dir($toPath)) {
             JFile::copy($fromFile, $toFile);
         }
     }
     return $result;
 }