This is the primary class that handles installing your web application.
Пример #1
0
        public ActionResult Run()
        {
            // Set the base path of the web application.
            path = Server.MapPath("~/");

            // Deserialize the installer.config xml file.
            InstallerConfig config = Serializer <InstallerConfig> .Deserialize(path + @"installer.config");

            config.Path.AppPath = path;  // set this for internal processing.

            JsonResponse json = new JsonResponse();

            try
            {
                // Run the installer.
                InstallWizard.Run(config);

                json.Success = true;
                json.Message = "The installer completed successfully!";
            }
            catch (Exception ex)
            {
                json.Success = false;
                json.Message = ex.Message;
            }

            return(Json(json));
        }
Пример #2
0
        public ActionResult Index()
        {
            // Now check if the application has already been installed.
            if (InstallWizard.Installed)
            {
                return(RedirectToAction("Index", "Home"));
            }


            path = Server.MapPath("~/");

            // Deserialize the installer.config xml file.
            InstallerConfig config = Serializer <InstallerConfig> .Deserialize(path + @"installer.config");

            // Update the web.config prior to running the procedure.
            InstallWizard.UpdateConfig(config);

            return(View(config));
        }