From d6c9f1f99122045a66135732abebbc54e4cf2cbd Mon Sep 17 00:00:00 2001 From: Morten Christensen Date: Tue, 27 Nov 2012 10:05:26 -0100 Subject: [PATCH] Reverting SolutionInfo. Updating DatabaseContext for installer although not fully working because of medium trust issue with refreshing connectionstrings. --- src/SolutionInfo.cs | 22 +++++++++---------- .../Configuration/UmbracoVersion.cs | 4 ++-- src/Umbraco.Core/DatabaseContext.cs | 11 ++++++++-- src/Umbraco.Web.UI/web.Template.config | 4 +--- .../install/steps/database.ascx.cs | 3 +++ .../install/utills/p.aspx.cs | 6 ++--- 6 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 3d34aa3222..4ffe6a35dd 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -1,12 +1,12 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security; +using System.Reflection; +using System.Resources; -//This is the core assembly information for the whole project -[assembly: AssemblyVersion("6.0.0.0")] -[assembly: AssemblyFileVersion("6.0.0.0")] -[assembly: AssemblyInformationalVersion("Umbraco 6.0")] -[assembly: AssemblyCompany("Umbraco")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("Umbraco")] -[assembly: AssemblyCulture("")] \ No newline at end of file +[assembly: AssemblyCompany("umbraco")] +[assembly: AssemblyCopyright("Copyright © Umbraco 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: NeutralResourcesLanguageAttribute("en-US")] + + +[assembly: AssemblyVersion("1.0.*")] diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index 58c4364da3..e6b1d5c2a6 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -4,7 +4,7 @@ namespace Umbraco.Core.Configuration { public class UmbracoVersion { - private static Version _version; + private static readonly Version Version = new Version(6,0,0); /// /// Gets the current version of Umbraco. @@ -15,7 +15,7 @@ namespace Umbraco.Core.Configuration /// public static Version Current { - get { return _version ?? (_version = typeof(UmbracoVersion).Assembly.GetName().Version); } + get { return Version; } } /// diff --git a/src/Umbraco.Core/DatabaseContext.cs b/src/Umbraco.Core/DatabaseContext.cs index 6139b210a5..309c9aeefc 100644 --- a/src/Umbraco.Core/DatabaseContext.cs +++ b/src/Umbraco.Core/DatabaseContext.cs @@ -1,7 +1,9 @@ using System; using System.Configuration; using System.Data.SqlServerCe; +using System.IO; using System.Linq; +using System.Web; using System.Web.Configuration; using System.Xml.Linq; using Umbraco.Core.Configuration; @@ -115,8 +117,13 @@ namespace Umbraco.Core SaveConnectionString(connectionString, appSettingsConnection, providerName); - var engine = new SqlCeEngine(connectionString); - engine.CreateDatabase(); + string appData = VirtualPathUtility.ToAbsolute(GlobalSettings.StorageDirectory); + var path = Path.Combine(appData, "Umbraco.sdf"); + if (File.Exists(path) == false) + { + var engine = new SqlCeEngine(connectionString); + engine.CreateDatabase(); + } Initialize(); } diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config index 58cc730610..b2a5ff660e 100644 --- a/src/Umbraco.Web.UI/web.Template.config +++ b/src/Umbraco.Web.UI/web.Template.config @@ -67,8 +67,6 @@ - - @@ -95,7 +93,7 @@ - + diff --git a/src/Umbraco.Web/umbraco.presentation/install/steps/database.ascx.cs b/src/Umbraco.Web/umbraco.presentation/install/steps/database.ascx.cs index b499bc58b7..87f55bf3e7 100644 --- a/src/Umbraco.Web/umbraco.presentation/install/steps/database.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/install/steps/database.ascx.cs @@ -174,6 +174,9 @@ namespace umbraco.presentation.install.steps DatabaseType.SelectedValue); } + if(DatabaseContext.Current.IsDatabaseConfigured == false) + throw new Exception("ConnectionString could not be found"); + Helper.setProgress(20, "Connection opened", ""); DatabaseContext.Current.Database.Initialize(); diff --git a/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs b/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs index 67fb8c6d78..df03550658 100644 --- a/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs @@ -93,7 +93,7 @@ namespace umbraco.presentation.install.utills Helper.setProgress(90, "Refreshing content cache", ""); - library.RefreshContent(); + //library.RefreshContent(); Helper.setProgress(100, "Database is up-to-date", ""); @@ -106,7 +106,7 @@ namespace umbraco.presentation.install.utills //do install try { - installer.Install(); + //installer.Install(); Helper.setProgress(100, "Installation completed!", ""); installer = null; @@ -129,7 +129,7 @@ namespace umbraco.presentation.install.utills else if (installer.CurrentVersion == DatabaseVersion.None || installer.CanUpgrade) { Helper.setProgress(35, "Updating database tables...", ""); - installer.Install(); + //installer.Install(); Helper.setProgress(100, "Upgrade completed!", "");