public ActionResult StepFour()
        {
            if (DataSettingsHelper.SiteIsInstalled)
                return RedirectToAction("index", "home");

            if (!DataSettingsHelper.DatabaseIsInstalled)
                return RedirectToRoute("Install");

            var manager = new DataSettingsManager();
            var settings = manager.LoadSettings();

            if (settings.SiteOwner == null)
                return RedirectToRoute("Install");

            var model = PrepareStepFourModel(siteOwner: settings.SiteOwner);
            return View(model);
        }
        public ActionResult StepFour(StepFourModel model)
        {
            if (DataSettingsHelper.SiteIsInstalled)
                return RedirectToAction("index", "home");

            if (!DataSettingsHelper.DatabaseIsInstalled)
                return RedirectToRoute("Install");

            // Load the local settings
            var manager = new DataSettingsManager();
            var settings = manager.LoadSettings();

            // Ensure the form is valid
            if (ModelState.IsValid)
            {
                var siteOwner = settings.SiteOwner;
                siteOwner.DisplayName = model.DisplayName;
                siteOwner.Email = model.Email;
                siteOwner.UserName = SeoExtensions.GetSeoName(model.UserName);

                // Install the rest of the site data
                var installService = EngineContext.Current.Resolve<IInstallService>();
                installService.InstallUserData(siteOwner, model.MailFromDisplayName, model.MailFromEmail, model.MailHost, model.MailPort, model.MailUsername, model.MailPassword, model.TwitterAccessToken, model.TwitterAccessTokenSecret);

                // Clear our the site owner data from the settings file
                settings.InstallComplete = true;
                settings.SiteOwner = null;
                manager.SaveSettings(settings);

                // Restart the application
                var webHelper = EngineContext.Current.Resolve<IWebHelper>();
                webHelper.RestartAppDomain();

                // Redirect home
                return RedirectToAction("index", "home");
            }

            model = PrepareStepFourModel(model);
            return View(model);
        }
        public ActionResult StepOne()
        {
            if (DataSettingsHelper.SiteIsInstalled)
                return RedirectToAction("index", "home");

            if (DataSettingsHelper.DatabaseIsInstalled)
                return RedirectToAction("steptwo", "install");

            var model = PrepareStepOneModel();

            var manager = new DataSettingsManager();
            var settings = manager.LoadSettings();
            if (settings != null)
            {
                var builder = new SqlConnectionStringBuilder(settings.ConnectionString);
                model.DatabaseName = builder.InitialCatalog;
                model.DatabasePassword = builder.Password;
                model.DatabaseServerName = builder.DataSource;
                model.DatabaseUsername = builder.UserID;
            }

            return View(model);
        }