Updated 2.0 portal upgrade code to make it idempotent
This commit is contained in:
parent
c0276a7369
commit
a187888c05
4 changed files with 14 additions and 10 deletions
|
@ -31,7 +31,7 @@ namespace WebsitePanel.Setup
|
||||||
{
|
{
|
||||||
return UpdateBase(obj,
|
return UpdateBase(obj,
|
||||||
minimalInstallerVersion: "2.0.0",
|
minimalInstallerVersion: "2.0.0",
|
||||||
versionToUpgrade: "1.2.1",
|
versionToUpgrade: "1.2.1,2.0.0",
|
||||||
updateSql: true);
|
updateSql: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace WebsitePanel.Setup
|
||||||
{
|
{
|
||||||
return UpdateBase(obj,
|
return UpdateBase(obj,
|
||||||
minimalInstallerVersion: "2.0.0",
|
minimalInstallerVersion: "2.0.0",
|
||||||
versionsToUpgrade: "1.2.1",
|
versionsToUpgrade: "1.2.1,2.0.0",
|
||||||
updateSql: false,
|
updateSql: false,
|
||||||
versionSpecificAction: new InstallAction(ActionTypes.ConfigureSecureSessionModuleInWebConfig));
|
versionSpecificAction: new InstallAction(ActionTypes.ConfigureSecureSessionModuleInWebConfig));
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ namespace WebsitePanel.Setup
|
||||||
{
|
{
|
||||||
return Server.UpdateBase(obj,
|
return Server.UpdateBase(obj,
|
||||||
minimalInstallerVersion: "2.0.0",
|
minimalInstallerVersion: "2.0.0",
|
||||||
versionToUpgrade: "1.2.1",
|
versionToUpgrade: "1.2.1,2.0.0",
|
||||||
updateSql: false);
|
updateSql: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,12 +325,16 @@ namespace WebsitePanel.Setup
|
||||||
|
|
||||||
if (webServer != null)
|
if (webServer != null)
|
||||||
{
|
{
|
||||||
var modules = doc.CreateElement(iis6 ? "httpModules" : "modules");
|
string modulesNodeName = iis6 ? "httpModules" : "modules";
|
||||||
webServer.AppendChild(modules);
|
if (webServer.SelectSingleNode(modulesNodeName + "/add[@name='SecureSession']") == null)
|
||||||
var sessionModule = doc.CreateElement("add");
|
{
|
||||||
sessionModule.SetAttribute("name", "SecureSession");
|
var modules = doc.CreateElement(modulesNodeName);
|
||||||
sessionModule.SetAttribute("type", "WebsitePanel.WebPortal.SecureSessionModule");
|
webServer.AppendChild(modules);
|
||||||
modules.AppendChild(sessionModule);
|
var sessionModule = doc.CreateElement("add");
|
||||||
|
sessionModule.SetAttribute("name", "SecureSession");
|
||||||
|
sessionModule.SetAttribute("type", "WebsitePanel.WebPortal.SecureSessionModule");
|
||||||
|
modules.AppendChild(sessionModule);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update /system.web/httpRuntime element
|
// update /system.web/httpRuntime element
|
||||||
|
@ -343,7 +347,7 @@ namespace WebsitePanel.Setup
|
||||||
// <add key="SessionValidationKey" value="XXXXXX" />
|
// <add key="SessionValidationKey" value="XXXXXX" />
|
||||||
//</appSettings>
|
//</appSettings>
|
||||||
var appSettings = doc.SelectSingleNode("configuration/appSettings");
|
var appSettings = doc.SelectSingleNode("configuration/appSettings");
|
||||||
if (appSettings != null)
|
if (appSettings != null && appSettings.SelectSingleNode("add[@key='SessionValidationKey']") == null)
|
||||||
{
|
{
|
||||||
var sessionKey = doc.CreateElement("add");
|
var sessionKey = doc.CreateElement("add");
|
||||||
sessionKey.SetAttribute("key", "SessionValidationKey");
|
sessionKey.SetAttribute("key", "SessionValidationKey");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue