public function setupExtensions(array $packages)
    {
        foreach ($packages as $package) {
            $this->extensionFactory->getExtensionStructure($package)->fix();
            $this->callInstaller('importInitialFiles', [PathUtility::stripPathSitePrefix($package->getPackagePath()), $package->getPackageKey()]);
            $this->extensionConfiguration->saveDefaultConfiguration($package->getPackageKey());
        }

        $this->schemaService->updateSchema(SchemaUpdateType::expandSchemaUpdateTypes(['safe']));

        foreach ($packages as $package) {
            $relativeExtensionPath = PathUtility::stripPathSitePrefix($package->getPackagePath());
            $extensionKey = $package->getPackageKey();
            $this->callInstaller('importStaticSqlFile', [$relativeExtensionPath]);
            $this->callInstaller('importT3DFile', [$relativeExtensionPath]);
            $this->callInstaller('emitAfterExtensionInstallSignal', [$extensionKey]);
        }
    }