From 71a9fb4f6831e8808d0d3c07b951d14837eb1274 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 4 Mar 2014 16:21:45 +1100 Subject: [PATCH] Updated more installer logic --- .../src/installer/installer.service.js | 20 +-- .../UmbracoInstall/Views/Install/Index.cshtml | 2 +- .../config/ClientDependency.config | 2 +- .../Controllers/InstallApiController.cs | 121 +++++++++++------- src/Umbraco.Web/Install/InstallException.cs | 8 +- .../Install/InstallStatusTracker.cs | 53 ++++---- .../InstallSteps/DatabaseConfigureStep.cs | 2 +- .../InstallSteps/DatabaseInstallStep.cs | 2 +- .../InstallSteps/DatabaseUpgradeStep.cs | 8 +- .../InstallSteps/FilePermissionsStep.cs | 2 +- .../MajorVersion7UpgradeReport.cs | 2 +- .../InstallSteps/SetUmbracoVersionStep.cs | 2 +- .../InstallSteps/StarterKitCleanupStep.cs | 8 +- .../InstallSteps/StarterKitDownloadStep.cs | 2 +- .../InstallSteps/StarterKitInstallStep.cs | 8 +- .../Install/InstallSteps/UserStep.cs | 2 +- .../Install/Models/InstallInstructions.cs | 17 +++ .../Install/Models/InstallSetup.cs | 6 +- .../Install/Models/InstallSetupStep.cs | 2 +- .../Models/InstallSetupStepAttribute.cs | 1 + .../Install/Models/InstallTrackingItem.cs | 26 +++- src/Umbraco.Web/Umbraco.Web.csproj | 1 + 22 files changed, 192 insertions(+), 105 deletions(-) create mode 100644 src/Umbraco.Web/Install/Models/InstallInstructions.cs diff --git a/src/Umbraco.Web.UI.Client/src/installer/installer.service.js b/src/Umbraco.Web.UI.Client/src/installer/installer.service.js index ca5e0e4fd4..4cf56f8db5 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/installer.service.js +++ b/src/Umbraco.Web.UI.Client/src/installer/installer.service.js @@ -9,8 +9,11 @@ angular.module("umbraco.install").factory('installerService', function($q, $time var _installerModel = { - DatabaseConfigure: {dbType: 0}, - StarterKitDownload: "69e44beb-15ff-4cee-8b64-0a7dae498657" + installId: undefined, + instructions: { + DatabaseConfigure: { dbType: 0 }, + StarterKitDownload: Umbraco.Sys.ServerVariables.defaultStarterKit + } }; var service = { @@ -31,6 +34,7 @@ angular.module("umbraco.install").factory('installerService', function($q, $time service.getSteps().then(function(response){ service.status.steps = response.data.steps; service.status.index = 0; + _installerModel.installId = response.data.installId; service.findNextStep(); $timeout(function(){ @@ -57,8 +61,8 @@ angular.module("umbraco.install").factory('installerService', function($q, $time }, findNextStep : function(){ - var step = _.find(service.status.steps, function(step, index){ - if(step.view && index >= service.status.index){ + var step = _.find(service.status.steps, function(s, index){ + if(s.view && index >= service.status.index){ service.status.index = index; return true; } @@ -80,7 +84,7 @@ angular.module("umbraco.install").factory('installerService', function($q, $time }, storeCurrentStep : function(){ - _installerModel[service.status.current.name] = service.status.current.model; + _installerModel.instructions[service.status.current.name] = service.status.current.model; }, forward : function(){ @@ -100,16 +104,16 @@ angular.module("umbraco.install").factory('installerService', function($q, $time service.status.feedback = []; service.status.loading = true; - var _feedback = 0; + var feedback = 0; service.status.feedback = service.status.steps[0].description; function processInstallStep(){ $http.post(Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostPerformInstall", _installerModel).then(function(response){ if(!response.data.complete){ - _feedback++; + feedback++; - var step = service.status.steps[_feedback]; + var step = service.status.steps[feedback]; if(step){ service.status.feedback = step.description; } diff --git a/src/Umbraco.Web.UI/Areas/UmbracoInstall/Views/Install/Index.cshtml b/src/Umbraco.Web.UI/Areas/UmbracoInstall/Views/Install/Index.cshtml index a4f7a942b1..307d0316dc 100644 --- a/src/Umbraco.Web.UI/Areas/UmbracoInstall/Views/Install/Index.cshtml +++ b/src/Umbraco.Web.UI/Areas/UmbracoInstall/Views/Install/Index.cshtml @@ -18,7 +18,7 @@ -
+ @*
*@
diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config index 002456f827..1e4c529156 100644 --- a/src/Umbraco.Web.UI/config/ClientDependency.config +++ b/src/Umbraco.Web.UI/config/ClientDependency.config @@ -10,7 +10,7 @@ NOTES: * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * A new version will invalidate both client and server cache and create new persisted files --> - +