diff --git a/src/Umbraco.Web/Install/Controllers/InstallController.cs b/src/Umbraco.Web/Install/Controllers/InstallController.cs
index 12b02c72bf..a4520c4c4e 100644
--- a/src/Umbraco.Web/Install/Controllers/InstallController.cs
+++ b/src/Umbraco.Web/Install/Controllers/InstallController.cs
@@ -35,6 +35,16 @@ namespace Umbraco.Web.Install.Controllers
// It's not considered an upgrade if the ConfigurationStatus is missing or empty.
if (string.IsNullOrWhiteSpace(GlobalSettings.ConfigurationStatus) == false)
{
+ Version current;
+ if (Version.TryParse(GlobalSettings.ConfigurationStatus, out current))
+ {
+ //check if we are on the current version, and not let the installer execute
+ if (current == UmbracoVersion.Current)
+ {
+ return Redirect(SystemDirectories.Umbraco.EnsureEndsWith('/'));
+ }
+ }
+
var result = _umbracoContext.Security.ValidateCurrentUser(false);
switch (result)
diff --git a/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs b/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs
index 504d50ad4d..bab2bddc40 100644
--- a/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs
+++ b/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs
@@ -65,16 +65,6 @@ namespace Umbraco.Web.Install
return false;
}
}
-
- /////
- ///// Override to throw exception instead of returning 401 result
- /////
- /////
- //protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
- //{
- // //they aren't authorized but the app has installed
- // throw new HttpException((int)global::System.Net.HttpStatusCode.Unauthorized, "You must login to view this resource.");
- //}
-
+
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs b/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs
index 93bbd530f0..ecaf2d6be1 100644
--- a/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs
+++ b/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs
@@ -2,6 +2,8 @@
using System.Web;
using System.Web.Mvc;
using Umbraco.Core;
+using Umbraco.Core.Configuration;
+using Umbraco.Core.IO;
using Umbraco.Web.Security;
using umbraco.BasePages;
@@ -74,13 +76,12 @@ namespace Umbraco.Web.Install
}
///
- /// Override to throw exception instead of returning 401 result
+ /// Override to redirect instead of throwing an exception
///
///
protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
{
- //they aren't authorized but the app has installed
- throw new HttpException((int)global::System.Net.HttpStatusCode.Unauthorized, "You must login to view this resource.");
+ filterContext.Result = new RedirectResult(SystemDirectories.Umbraco.EnsureEndsWith('/'));
}
}
diff --git a/src/Umbraco.Web/Install/InstallHelper.cs b/src/Umbraco.Web/Install/InstallHelper.cs
index 2e95ca5783..d1885818b3 100644
--- a/src/Umbraco.Web/Install/InstallHelper.cs
+++ b/src/Umbraco.Web/Install/InstallHelper.cs
@@ -19,72 +19,64 @@ namespace Umbraco.Web.Install
{
//TODO: Add UserToken step to save our user token with Mother
- var steps = new List();
- if (status == InstallStatus.NewInstall)
+ var steps = new List(new InstallSetupStep[]
{
- //The step order returned here is how they will appear on the front-end
- steps.AddRange(new InstallSetupStep[]
+ new FilePermissionsStep()
{
- new FilePermissionsStep()
- {
- ServerOrder = 0,
- },
- new UserStep(umbracoContext.Application)
- {
- ServerOrder = 4,
- },
- new DatabaseConfigureStep(umbracoContext.Application)
- {
- ServerOrder = 1,
- },
- new DatabaseInstallStep(umbracoContext.Application)
- {
- ServerOrder = 2,
- },
- new DatabaseUpgradeStep(umbracoContext.Application)
- {
- ServerOrder = 3,
- },
- new StarterKitDownloadStep()
- {
- ServerOrder = 5,
- },
- new StarterKitInstallStep(umbracoContext.Application, umbracoContext.HttpContext)
- {
- ServerOrder = 6,
- },
- new StarterKitCleanupStep()
- {
- ServerOrder = 7,
- },
- new SetUmbracoVersionStep(umbracoContext.Application, umbracoContext.HttpContext) {
- ServerOrder = 8
- }
- });
- return steps;
- }
- else
- {
- //TODO: Add steps for upgrades
- }
- return null;
- }
-
- public static bool IsNewInstall
- {
- get
- {
- var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
- if (databaseSettings != null && (
- databaseSettings.ConnectionString.Trim() == string.Empty
- && databaseSettings.ProviderName.Trim() == string.Empty
- && GlobalSettings.ConfigurationStatus == string.Empty))
+ ServerOrder = 0,
+ },
+ new UserStep(umbracoContext.Application, status)
{
- return true;
+ ServerOrder = 4,
+ },
+ new DatabaseConfigureStep(umbracoContext.Application)
+ {
+ ServerOrder = 1,
+ },
+ new DatabaseInstallStep(umbracoContext.Application)
+ {
+ ServerOrder = 2,
+ },
+ new DatabaseUpgradeStep(umbracoContext.Application)
+ {
+ ServerOrder = 3,
+ },
+ new StarterKitDownloadStep(status)
+ {
+ ServerOrder = 5,
+ },
+ new StarterKitInstallStep(status, umbracoContext.Application, umbracoContext.HttpContext)
+ {
+ ServerOrder = 6,
+ },
+ new StarterKitCleanupStep(status)
+ {
+ ServerOrder = 7,
+ },
+ new SetUmbracoVersionStep(umbracoContext.Application, umbracoContext.HttpContext)
+ {
+ ServerOrder = 8
}
+ });
- return false;
- }
+ return steps;
}
+
+ //public static bool IsNewInstall
+ //{
+ // get
+ // {
+ // var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
+ // if (databaseSettings != null && (
+ // databaseSettings.ConnectionString.Trim() == string.Empty
+ // && databaseSettings.ProviderName.Trim() == string.Empty
+ // && GlobalSettings.ConfigurationStatus == string.Empty))
+ // {
+ // return true;
+ // }
+
+ // return false;
+ // }
+ //}
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs b/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs
index c220dbc702..9766fda371 100644
--- a/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs
+++ b/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs
@@ -10,8 +10,17 @@ namespace Umbraco.Web.Install.InstallSteps
[InstallSetupStep("StarterKitCleanup", "")]
internal class StarterKitCleanupStep : InstallSetupStep