public function actionIndex($lang = '')
    {
        $model = new InstallForm();

        if (!empty($lang)) {
            Yii::$app->language = $lang;
            $model->language = $lang;
        }

        if ($model->load(Yii::$app->request->post()) && $model->validate()) {

            $this->createEnvFile($model);

            Yii::$app->language = $model->language;
            Yii::$app->setTimeZone($model->timeZone);

            $installMessages = $this->processMigrations();
            $this->initRbac($model);

            $messages = $this->callModulesMethod('migrateUp');
            $installMessages .= implode('\n', $messages);

            $messages = $this->callModulesMethod('afterInstall');
            $installMessages .= implode('\n', $messages);

            return $this->render('resume', [
                'messages' => $installMessages
            ]);
        }

        return $this->render('index', [
            'model' => $model
        ]);
    }