public static function getInstallName(
        \Composer\Package\PackageInterface $package,
        \Composer\Package\PackageInterface $rootPackage = null
    ) {
        $packagePrettyName = $package->getPrettyName();
        $packageName = $package->getName();
        $installName = null;

        $rootPackageExtra = $rootPackage ? $rootPackage->getExtra() : null;
        if (!empty($rootPackageExtra['installer-name'])) {
            $installName = $this->mapRootExtra($rootPackageExtra['installer-name'], $packagePrettyName);
        }

        if (!$installName) {
            $packageExtra = $package->getExtra();
            if (!empty($packageExtra['installer-name'])) {
                $installName = $packageExtra['installer-name'];
            }
        }

        return $installName ?: static::guessInstallName($packageName);
    }