diff --git a/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs b/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs index 33cbac3301..fdc672c534 100644 --- a/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs +++ b/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs @@ -164,7 +164,7 @@ namespace Umbraco.Web.Compose // only perform this one time ever LazyInitializer.EnsureInitialized(ref _tasks, ref _started, ref _locker, () => { - var serverAddress = _runtime.ApplicationUrl?.ToString(); + var serverAddress = _runtime.ApplicationUrl.ToString(); return new[] { diff --git a/src/Umbraco.Infrastructure/Composing/CompositionExtensions/Installer.cs b/src/Umbraco.Infrastructure/Composing/CompositionExtensions/Installer.cs index 45e3b12582..0b9fb65606 100644 --- a/src/Umbraco.Infrastructure/Composing/CompositionExtensions/Installer.cs +++ b/src/Umbraco.Infrastructure/Composing/CompositionExtensions/Installer.cs @@ -20,11 +20,11 @@ namespace Umbraco.Web.Composing.CompositionExtensions composition.Register(Lifetime.Scope); // TODO: Add these back once we have a compatible Starter kit - // composition.Register(Lifetime.Scope); - // composition.Register(Lifetime.Scope); - // composition.Register(Lifetime.Scope); + // composition.Register(Lifetime.Scope); + // composition.Register(Lifetime.Scope); + // composition.Register(Lifetime.Scope); - composition.Register(Lifetime.Scope); + composition.Register(Lifetime.Scope); composition.Register(); composition.Register(); diff --git a/src/Umbraco.Infrastructure/Install/InstallSteps/NewInstallStep.cs b/src/Umbraco.Infrastructure/Install/InstallSteps/NewInstallStep.cs index 1a8553690d..6ce8da37d0 100644 --- a/src/Umbraco.Infrastructure/Install/InstallSteps/NewInstallStep.cs +++ b/src/Umbraco.Infrastructure/Install/InstallSteps/NewInstallStep.cs @@ -59,7 +59,7 @@ namespace Umbraco.Web.Install.InstallSteps _userService.Save(admin); - //TODO: This needs to be reintroduced, when members are compatible with ASP.NET Core Identity. + //TODO: This needs to be reintroduced, when users are compatible with ASP.NET Core Identity. // var userManager = _httpContextAccessor.GetRequiredHttpContext().GetOwinContext().GetBackOfficeUserManager(); // var membershipUser = await userManager.FindByIdAsync(Constants.Security.SuperUserId.ToString()); // if (membershipUser == null) diff --git a/src/Umbraco.Infrastructure/Install/InstallSteps/SetUmbracoVersionStep.cs b/src/Umbraco.Infrastructure/Install/InstallSteps/SetUmbracoVersionStep.cs index 8eac6711c4..190e24d64b 100644 --- a/src/Umbraco.Infrastructure/Install/InstallSteps/SetUmbracoVersionStep.cs +++ b/src/Umbraco.Infrastructure/Install/InstallSteps/SetUmbracoVersionStep.cs @@ -27,6 +27,7 @@ namespace Umbraco.Web.Install.InstallSteps public override Task ExecuteAsync(object model) { + //TODO: This needs to be reintroduced, when users are compatible with ASP.NET Core Identity. // var security = _umbracoContextAccessor.GetRequiredUmbracoContext().Security; // if (security.IsAuthenticated() == false && _globalSettings.ConfigurationStatus.IsNullOrWhiteSpace()) // { diff --git a/src/Umbraco.Infrastructure/Persistence/IEmbeddedDatabaseCreator.cs b/src/Umbraco.Infrastructure/Persistence/IEmbeddedDatabaseCreator.cs index 45a9617cb1..049001b67f 100644 --- a/src/Umbraco.Infrastructure/Persistence/IEmbeddedDatabaseCreator.cs +++ b/src/Umbraco.Infrastructure/Persistence/IEmbeddedDatabaseCreator.cs @@ -5,14 +5,4 @@ string ProviderName { get; } void Create(); } - - public class NoopEmbeddedDatabaseCreator : IEmbeddedDatabaseCreator - { - public string ProviderName => Constants.DatabaseProviders.SqlServer; - - public void Create() - { - - } - } } diff --git a/src/Umbraco.Infrastructure/Persistence/NoopEmbeddedDatabaseCreator.cs b/src/Umbraco.Infrastructure/Persistence/NoopEmbeddedDatabaseCreator.cs new file mode 100644 index 0000000000..a12819f9f0 --- /dev/null +++ b/src/Umbraco.Infrastructure/Persistence/NoopEmbeddedDatabaseCreator.cs @@ -0,0 +1,12 @@ +namespace Umbraco.Core.Persistence +{ + public class NoopEmbeddedDatabaseCreator : IEmbeddedDatabaseCreator + { + public string ProviderName => Constants.DatabaseProviders.SqlServer; + + public void Create() + { + + } + } +} diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs index bb895f61e2..429b2e625a 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -28,7 +28,6 @@ namespace Umbraco.Web.BackOffice.Controllers // GET public IActionResult Index() { - _umbracoApplicationLifetime.Restart(); //TODO remove return View(); } diff --git a/src/Umbraco.Web.Common/Extensions/ViewDataExtensions.cs b/src/Umbraco.Web.Common/Extensions/ViewDataExtensions.cs index d09cffd0dc..a76393cc22 100644 --- a/src/Umbraco.Web.Common/Extensions/ViewDataExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/ViewDataExtensions.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.ViewFeatures; +using Semver; namespace Umbraco.Web @@ -9,6 +10,7 @@ namespace Umbraco.Web public const string TokenUmbracoPath = "UmbracoPath"; public const string TokenInstallApiBaseUrl = "InstallApiBaseUrl"; public const string TokenUmbracoBaseFolder = "UmbracoBaseFolder"; + public const string TokenUmbracoVersion = "UmbracoVersion"; public const string TokenExternalSignInError = "ExternalSignInError"; public const string TokenPasswordResetCode = "PasswordResetCode"; @@ -48,6 +50,15 @@ namespace Umbraco.Web { viewData[TokenUmbracoBaseFolder] = value; } + public static void SetUmbracoVersion(this ViewDataDictionary viewData, SemVersion version) + { + viewData[TokenUmbracoVersion] = version; + } + + public static SemVersion GetUmbracoVersion(this ViewDataDictionary viewData) + { + return (SemVersion) viewData[TokenUmbracoVersion]; + } public static IEnumerable GetExternalSignInError(this ViewDataDictionary viewData) { diff --git a/src/Umbraco.Web.Common/Install/InstallController.cs b/src/Umbraco.Web.Common/Install/InstallController.cs index 9762a6505e..3fc863c5c1 100644 --- a/src/Umbraco.Web.Common/Install/InstallController.cs +++ b/src/Umbraco.Web.Common/Install/InstallController.cs @@ -24,6 +24,7 @@ namespace Umbraco.Web.Common.Install private readonly IRuntimeState _runtime; private readonly IGlobalSettings _globalSettings; private readonly IHostingEnvironment _hostingEnvironment; + private readonly IUmbracoVersion _umbracoVersion; private readonly IRuntimeMinifier _runtimeMinifier; public InstallController( @@ -32,7 +33,8 @@ namespace Umbraco.Web.Common.Install IRuntimeState runtime, IGlobalSettings globalSettings, IRuntimeMinifier runtimeMinifier, - IHostingEnvironment hostingEnvironment) + IHostingEnvironment hostingEnvironment, + IUmbracoVersion umbracoVersion) { _umbracoContextAccessor = umbracoContextAccessor; _installHelper = installHelper; @@ -40,6 +42,7 @@ namespace Umbraco.Web.Common.Install _globalSettings = globalSettings; _runtimeMinifier = runtimeMinifier; _hostingEnvironment = hostingEnvironment; + _umbracoVersion = umbracoVersion; } [HttpGet] @@ -64,12 +67,14 @@ namespace Umbraco.Web.Common.Install } } - // gen the install base url + // gen the install base urlAddUmbracoCore ViewData.SetInstallApiBaseUrl(Url.GetUmbracoApiService("GetSetup", "InstallApi", "UmbracoInstall").TrimEnd("GetSetup")); // get the base umbraco folder ViewData.SetUmbracoBaseFolder(_hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath)); + ViewData.SetUmbracoVersion(_umbracoVersion.SemanticVersion); + _installHelper.InstallStatus(false, ""); // always ensure full path (see NOTE in the class remarks) diff --git a/src/Umbraco.Web.UI.Client/src/common/interceptors/culturerequest.interceptor.js b/src/Umbraco.Web.UI.Client/src/common/interceptors/culturerequest.interceptor.js index 186f3accf0..b26c217437 100644 --- a/src/Umbraco.Web.UI.Client/src/common/interceptors/culturerequest.interceptor.js +++ b/src/Umbraco.Web.UI.Client/src/common/interceptors/culturerequest.interceptor.js @@ -10,7 +10,7 @@ //dealing with requests: 'request': function (config) { - if (!Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath) { + if (!Umbraco.Sys.ServerVariablesUmbraco.Sys.ServerVariables.umbracoSettings.umbracoPath) { // no settings available, we're probably on the login screen return config; } 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 68b1153c21..7cebaaada3 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/installer.service.js +++ b/src/Umbraco.Web.UI.Client/src/installer/installer.service.js @@ -237,7 +237,7 @@ angular.module("umbraco.install").factory('installerService', function ($rootSco service.status.feedback = getDescriptionForStepAtIndex(service.status.steps, 0); service.status.progress = 0; - function processInstallStep(retry) { + function processInstallStep() { $http.post(Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostPerformInstall", _installerModel) .then(function (response) { diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js b/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js index 9f0108853f..896a7a54f5 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js @@ -1,5 +1,6 @@ angular.module("umbraco.install").controller("Umbraco.Install.UserController", function($scope, installerService) { + $scope.majorVersion = Umbraco.Sys.ServerVariables.application.version; $scope.passwordPattern = /.*/; $scope.installer.current.model.subscribeToNewsLetter = false; diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/user.html b/src/Umbraco.Web.UI.Client/src/installer/steps/user.html index d2aeb6cdc4..dade65df31 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/user.html +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/user.html @@ -1,7 +1,7 @@ 
-

Install Umbraco 9

+

Install Umbraco {{majorVersion}}

-

Enter your name, email and password to install Umbraco 9 with its default settings, alternatively you can customize your installation

+

Enter your name, email and password to install Umbraco {{majorVersion}} with its default settings, alternatively you can customize your installation

@@ -15,7 +15,7 @@
-
+
processInstallStep
diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js index 732aa898a7..67cc627f4b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js @@ -5,7 +5,7 @@ * * @description * The controller for the doc type creation dialog - */ + */Umbraco.Sys.ServerVariables function DocumentTypesCreateController($scope, $location, navigationService, contentTypeResource, formHelper, appState, notificationsService, localizationService, iconHelper) { $scope.model = { diff --git a/src/Umbraco.Web.UI.NetCore/Views/Install/Index.cshtml b/src/Umbraco.Web.UI.NetCore/Views/Install/Index.cshtml index 86b4ec4e40..8ebd135ff3 100644 --- a/src/Umbraco.Web.UI.NetCore/Views/Install/Index.cshtml +++ b/src/Umbraco.Web.UI.NetCore/Views/Install/Index.cshtml @@ -1,4 +1,5 @@ @using Umbraco.Web +@using Umbraco.Composing @{ Layout = null; } @@ -67,7 +68,10 @@ Umbraco.Sys = {}; Umbraco.Sys.ServerVariables = { "installApiBaseUrl": "@ViewData.GetInstallApiBaseUrl()", - "umbracoBaseUrl": "@ViewData.GetUmbracoBaseFolder()" + "umbracoBaseUrl": "@ViewData.GetUmbracoBaseFolder()", + "application": { + version: "@ViewData.GetUmbracoVersion().Major" + } }; diff --git a/src/Umbraco.Web.UI.NetCore/appsettings.json b/src/Umbraco.Web.UI.NetCore/appsettings.json index e9d34dce46..29be35e386 100644 --- a/src/Umbraco.Web.UI.NetCore/appsettings.json +++ b/src/Umbraco.Web.UI.NetCore/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "umbracoDbDSN": "Data Source=|DataDirectory|\\Umbraco.sdf;Flush Interval=1;" + "umbracoDbDSN": "" }, "Logging": { "LogLevel": { @@ -119,4 +119,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Web/UmbracoContextFactory.cs b/src/Umbraco.Web/UmbracoContextFactory.cs index 118ccd2901..719785c1fb 100644 --- a/src/Umbraco.Web/UmbracoContextFactory.cs +++ b/src/Umbraco.Web/UmbracoContextFactory.cs @@ -15,8 +15,6 @@ namespace Umbraco.Web /// public class UmbracoContextFactory : IUmbracoContextFactory { - private static readonly NullWriter NullWriterInstance = new NullWriter(); - private readonly IUmbracoContextAccessor _umbracoContextAccessor; private readonly IPublishedSnapshotService _publishedSnapshotService; private readonly IVariationContextAccessor _variationContextAccessor; @@ -87,11 +85,5 @@ namespace Umbraco.Web return new UmbracoContextReference(umbracoContext, true, _umbracoContextAccessor); } - - // dummy TextWriter that does not write - private class NullWriter : TextWriter - { - public override Encoding Encoding => Encoding.UTF8; - } } }