/**
 * Clean up temporary uploaded package and unpacked extension
 *
 * @param   string  $package    Path to the uploaded package file
 * @param   string  $resultdir  Path to the unpacked extension
 *
 * @return  boolean  True on success
 *
 * @since   3.1
 */
public static function cleanupInstall($package, $resultdir)
{
    // Does the unpacked extension directory exist?
    if ($resultdir && is_dir($resultdir)) {
        Folder::delete($resultdir);
    }
    // Is the package file a valid file?
    if (is_file($package)) {
        File::delete($package);
    } elseif (is_file(Path::clean(Factory::getApplication()->get('tmp_path') . '/' . $package))) {
        // It might also be just a base filename
        File::delete(Path::clean(Factory::getApplication()->get('tmp_path') . '/' . $package));
    }
}