public static void Process([NotNull] string rootFolderPath, [NotNull] string webRootPath, [NotNull] string dataFolder) { Assert.ArgumentNotNull(rootFolderPath, "rootFolderPath"); Assert.ArgumentNotNull(webRootPath, "webRootPath"); Assert.ArgumentNotNull(dataFolder, "dataFolder"); if (Settings.CoreInstallHttpRuntimeExecutionTimeout.HasUserValue) { var executionTimeout = Settings.CoreInstallHttpRuntimeExecutionTimeout.Value; var webConfig = XmlDocumentEx.LoadFile(Path.Combine(webRootPath, "web.config")); var systemWeb = webConfig.SelectSingleElement("/configuration/system.web"); if (systemWeb == null) { systemWeb = webConfig.CreateElement("system.web"); webConfig.DocumentElement.AppendChild(systemWeb); } var httpRuntime = systemWeb.SelectSingleElement("httpRuntime"); if (httpRuntime == null) { httpRuntime = webConfig.CreateElement("httpRuntime"); systemWeb.AppendChild(httpRuntime); } httpRuntime.SetAttribute("executionTimeout", executionTimeout.ToString()); webConfig.Save(); } SetupWebsiteHelper.SetDataFolder(rootFolderPath, dataFolder); if (Settings.CoreInstallNotFoundTransfer.Value) { CreateIncludeFile(rootFolderPath, "UseServerSideRedirect.config", new NameValueCollection { { "RequestErrors.UseServerSideRedirect", "true" } }); } var addressString = Settings.CoreInstallMailServerAddress.Value; if (string.IsNullOrEmpty(addressString)) { return; } var credentialsString = Settings.CoreInstallMailServerCredentials.Value; var address = Parameters.Parse(addressString); var host = address[0]; var port = address[1]; var credentials = Parameters.Parse(credentialsString); var username = credentials[0]; var password = credentials[1]; var settings = new NameValueCollection { { "MailServer", host }, { "MailServerPort", port }, { "MailServerUserName", username }, { "MailServerPassword", password } }; CreateIncludeFile(rootFolderPath, "MailServer.config", settings); }
public static void Process([NotNull] string rootFolderPath, [NotNull] string webRootPath, [NotNull] string dataFolder, bool serverSideRedirect, bool increaseExecutionTimeout, Product product) { Assert.ArgumentNotNull(rootFolderPath, nameof(rootFolderPath)); Assert.ArgumentNotNull(webRootPath, nameof(webRootPath)); Assert.ArgumentNotNull(dataFolder, nameof(dataFolder)); if (increaseExecutionTimeout) { var executionTimeout = Settings.CoreInstallHttpRuntimeExecutionTimeout.Value; if (!string.IsNullOrEmpty(executionTimeout)) { var webConfig = XmlDocumentEx.LoadFile(Path.Combine(webRootPath, "web.config")); var httpRuntime = GetHttpRuntime(webConfig, true); if (httpRuntime == null) { Log.Error("Cannot extend executionTimeout as httpRuntime element is missing"); } else { httpRuntime.SetAttribute("executionTimeout", executionTimeout); webConfig.Save(); } } } SetupWebsiteHelper.SetDataFolder(rootFolderPath, dataFolder); if (serverSideRedirect) { CreateSettingsIncludeFile(rootFolderPath, "UseServerSideRedirect.config", new NameValueCollection { { "RequestErrors.UseServerSideRedirect", "true" } }); } var addressString = Settings.CoreInstallMailServerAddress.Value; if (!string.IsNullOrEmpty(addressString)) { var credentialsString = Settings.CoreInstallMailServerCredentials.Value; var address = Parameters.Parse(addressString); var host = address[0]; var port = address[1]; var credentials = Parameters.Parse(credentialsString); var username = credentials[0]; var password = credentials[1]; var settings = new NameValueCollection { { "MailServer", host }, { "MailServerPort", port }, { "MailServerUserName", username }, { "MailServerPassword", password } }; CreateSettingsIncludeFile(rootFolderPath, "MailServer.config", settings); } if (product.Name == "Sitecore CMS" && product.Version.StartsWith("9.0")) { CreateSettingsIncludeFile(rootFolderPath, "DisableXdb.config", new NameValueCollection { { "Xdb.Enabled", "false" } }); } }
public static void Process([NotNull] string rootFolderPath, [NotNull] string webRootPath, [NotNull] string dataFolder, bool serverSideRedirect, bool increaseExecutionTimeout) { Assert.ArgumentNotNull(rootFolderPath, "rootFolderPath"); Assert.ArgumentNotNull(webRootPath, "webRootPath"); Assert.ArgumentNotNull(dataFolder, "dataFolder"); if (increaseExecutionTimeout) { var executionTimeout = Settings.CoreInstallHttpRuntimeExecutionTimeout.Value; var webConfig = XmlDocumentEx.LoadFile(Path.Combine(webRootPath, "web.config")); var httpRuntime = GetHttpRuntime(webConfig, true); httpRuntime.SetAttribute("executionTimeout", executionTimeout.ToString()); webConfig.Save(); } SetupWebsiteHelper.SetDataFolder(rootFolderPath, dataFolder); if (serverSideRedirect) { CreateIncludeFile(rootFolderPath, "UseServerSideRedirect.config", new NameValueCollection { { "RequestErrors.UseServerSideRedirect", "true" } }); } var addressString = Settings.CoreInstallMailServerAddress.Value; if (string.IsNullOrEmpty(addressString)) { return; } var credentialsString = Settings.CoreInstallMailServerCredentials.Value; var address = Parameters.Parse(addressString); var host = address[0]; var port = address[1]; var credentials = Parameters.Parse(credentialsString); var username = credentials[0]; var password = credentials[1]; var settings = new NameValueCollection { { "MailServer", host }, { "MailServerPort", port }, { "MailServerUserName", username }, { "MailServerPassword", password } }; CreateIncludeFile(rootFolderPath, "MailServer.config", settings); }