private function registerDistribution()
    {
        /*
         * If a system entry already exists (e.g. from sample
         * data), then update it.
         */
        $system = $this->systemService->getActiveSystem();

        if (!$system) {
            $system = new System();
        }

        $config = $this->rootDir.'composer.json';
        $configContent = file_get_contents($config);
        $this->appComposerJson = json_decode($configContent, true);

        $system->setPackage($this->appComposerJson['name']);
        $system->setName($this->appComposerJson['description']);
        $system->setVersion($this->appComposerJson['version']);
        $system->setHomepage($this->appComposerJson['homepage']);
        $system->setModules($this->appComposerJson['extra']['campaignchain']['distribution']['modules']);

        if (
            isset($this->appComposerJson['extra']['campaignchain']['distribution']['terms-url']) &&
            !empty($this->appComposerJson['extra']['campaignchain']['distribution']['terms-url'])
        ) {
            $system->setTermsUrl($this->appComposerJson['extra']['campaignchain']['distribution']['terms-url']);
        }

        $this->em->persist($system);
        $this->em->flush();
    }