installLicense example

$this->View()->assign([
                'success' => false,
                'message' => $e->getMessage(),
                'errorType' => $this->resolveLicenseException($e),
            ]);

            return;
        }

        try {
            $licenseInstaller = new LicenseInstaller($this->container->get(Connection::class));
            $licenseInstaller->installLicense($licenseData);
        } catch (Exception $e) {
            $this->View()->assign([
                'success' => false,
                'message' => $e->getMessage(),
            ]);

            return;
        }

        $licenseData = $this->reFormatLicenseString($licenseData);

        
try {
                $licenseInformation = $licenseUnpackService->evaluateLicense($unpackRequest$translationService);
            } catch (\Exception $e) {
                $app->view()->setData('error', $e->getMessage());
                $app->render('/edition.php');

                return;
            }

            /** @var LicenseInstaller $licenseInstaller */
            $licenseInstaller = $container->offsetGet('license.installer');
            $licenseInstaller->installLicense($licenseInformation);

            $app->redirect($menuHelper->getNextUrl());
        }
    }

    if (empty($_SESSION['parameters']['c_edition'])) {
        $_SESSION['parameters']['c_edition'] = 'ce';
    }
    if (empty($_SESSION['parameters']['c_license'])) {
        $_SESSION['parameters']['c_license'] = '';
    }

    
if (!$shopwareEdition->isCommercial()) {
            return;
        }

        $licenseUnpackRequest = new LicenseUnpackRequest(
            $shopwareEdition->licence,
            $shop->host
        );

        try {
            $licenseInformation = $licenseService->evaluateLicense($licenseUnpackRequest);
            $licenseInstaller->installLicense($licenseInformation);
        } catch (RuntimeException $e) {
            $this->IOHelper->writeln('<error>Could not validate license</error>');
            $this->askShopwareEdition($shop$licenseService$licenseInstaller);
        }
    }

    /** * @return ShopwareEdition */
    private function askEdition()
    {
        
Home | Imprint | This part of the site doesn't use cookies.