diff --git a/src/Umbraco.Web.UI/install/steps/database.ascx b/src/Umbraco.Web.UI/install/steps/database.ascx index 38c3f9a507..3de5f6a398 100644 --- a/src/Umbraco.Web.UI/install/steps/database.ascx +++ b/src/Umbraco.Web.UI/install/steps/database.ascx @@ -1,353 +1,359 @@ <%@ Control Language="c#" AutoEventWireup="True" CodeBehind="database.ascx.cs" Inherits="umbraco.presentation.install.steps.detect" - TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> + TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> - -
-
-

Database configuration

-

- To complete this step you will either need a blank database or, if you do not have a blank database available, choose the SQL CE 4 embedded - database (This is the recommended approach for first time users or if you are unsure).

+ +
+
+

Database configuration

- If you are not using the SQL CE 4 embedded database you will need the connection details for your database, such as the - "connection string". You may need to contact your system administrator or web host for this information.

-
- -
-
-
-
-
-

- 1. Select which database option best fits you:

+ To complete this step you will either need a blank database or, if you do not have a blank database available, choose the SQL CE 4 embedded + database (This is the recommended approach for first time users or if you are unsure). +

+

+ If you are not using the SQL CE 4 embedded database you will need the connection details for your database, such as the + "connection string". You may need to contact your system administrator or web host for this information. +

+
+ +
+ +
+
+
+

+ 1. Select which database option best fits you: +

    -
  • - - +
  • + + -
  • -
  • - - +
  • +
  • + + -
  • -
  • - - +
  • +
  • + + -
  • -
  • - - +
  • +
  • + + -
  • +
- -
-
- -
- - -
- -
-
-

- 2. Now choose your database type below.

-
- - - - - - - -
-
-
- - -
-
-

- 3. Connection details: Please fill out the connection information for your database.

-
- - - -
-

- -

-
- -
-
- Server: - - -
-
- Database name: - - -
-
- Username: - - -
-
- Password: - - -
- -
-
- - -
-
- - -
-
-
- -

- 2. Simple file-based database:

-
- - - - -
-
- -
-
-
-

- 2. Connection details: Please fill out the connection information for your database.

+ +
-
- -
- Connection string: - - -
-
+ + +
+ +
+

- Example: datalayer=MySQL;server=192.168.2.8;user id=user;password=***;database=umbraco

-
+ 2. Now choose your database type below. +

+
+ + + + + + +
+
+ + +
+
+

+ 3. Connection details: Please fill out the connection information for your database. +

+
+ + + +
+

+ + +

+
+ +
+
+ Server: + + +
+
+ Database name: + + +
+
+ Username: + + +
+
+ Password: + + +
+ +
+
+ +
-
- -
-
-
-

- 2. Getting a database setup for umbraco.
- For first time users, we recommend you select "quick-and-simple embedded database". + +

+
+
+ +

+ 2. Simple file-based database: +

+
+ + + + +
+
+
+
+ +
+
+
+

+ 2. Connection details: Please fill out the connection information for your database. +

+ +
+ +
+ Connection string: + + +
+
+

+ Example: datalayer=MySQL;server=192.168.2.8;user id=user;password=***;database=umbraco +

+
+ +
+
+
+
+ + +
+
+
+

+ 2. Getting a database setup for umbraco.
+ For first time users, we recommend you select "quick-and-simple embedded database". This will install an easy to use database, that does not require any additional software to use.
- Alternatively, you can install Microsoft SQL Server, which will require a bit more + Alternatively, you can install Microsoft SQL Server, which will require a bit more work to get up and running.
- We have provided a step-by-step guide in the video instructions below. -

- Open video instructions + We have provided a step-by-step guide in the video instructions below. +

+ Open video instructions +
+ +
+
 
+ install +
+
-
-
 
- install -
- -
- -
- -
-
- - -
-
-

- Installing Umbraco

-

- The Umbraco database is being configured. This process populates your chosen database with a blank Umbraco instance.

-
-
-
-
- 0% -
- -
-
- -
-
 
- Continue - -
-
+ +
+
+

Installing Umbraco

+

+ The Umbraco database is being configured. This process populates your chosen database with a blank Umbraco instance. +

+
+
+
+
+ 0% +
+ +
+
+ +
+
 
+ Continue + +
+
- + if (data.Percentage == 100) { + clearInterval(intervalId); + jQuery(".btn-box").show(); + jQuery('.ui-progressbar-value').css("background-image", "url(../umbraco_client/installer/images/pbar.gif)"); + } + }); + } +
- -

- Database installed

-
-

- Umbraco + +

Database installed

+
+

+ Umbraco <%=umbraco.GlobalSettings.CurrentVersion%> - has now been copied to your database. Press Continue to proceed.

-
- - -

- Database upgraded

-
-

- Your database has been upgraded to version: + has now been copied to your database. Press Continue to proceed. +

+
+
+ +

Database upgraded

+
+

+ Your database has been upgraded to version: <%=umbraco.GlobalSettings.CurrentVersion%>.
- Press Continue to proceed. -

-
-
- -
-
 
- Continue -
+ Press Continue to proceed. +

+
+
+ +
+
 
+ Continue +
diff --git a/src/Umbraco.Web.UI/umbraco_client/Installer/js/jquery.main.js b/src/Umbraco.Web.UI/umbraco_client/Installer/js/jquery.main.js index 5f2b202bd3..1a0330e4c9 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Installer/js/jquery.main.js +++ b/src/Umbraco.Web.UI/umbraco_client/Installer/js/jquery.main.js @@ -29,8 +29,11 @@ function updateProgressBar(percent) { }); } -function updateStatusMessage(message) { +function updateStatusMessage(message, error) { jQuery(".loader > strong").text(message); + if (error != undefined) { + jQuery(".loader").append("

" + error + "

"); + } } diff --git a/src/Umbraco.Web/umbraco.presentation/install/steps/database.ascx b/src/Umbraco.Web/umbraco.presentation/install/steps/database.ascx index 38c3f9a507..3de5f6a398 100644 --- a/src/Umbraco.Web/umbraco.presentation/install/steps/database.ascx +++ b/src/Umbraco.Web/umbraco.presentation/install/steps/database.ascx @@ -1,353 +1,359 @@ <%@ Control Language="c#" AutoEventWireup="True" CodeBehind="database.ascx.cs" Inherits="umbraco.presentation.install.steps.detect" - TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> + TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> - -
-
-

Database configuration

-

- To complete this step you will either need a blank database or, if you do not have a blank database available, choose the SQL CE 4 embedded - database (This is the recommended approach for first time users or if you are unsure).

+ +
+
+

Database configuration

- If you are not using the SQL CE 4 embedded database you will need the connection details for your database, such as the - "connection string". You may need to contact your system administrator or web host for this information.

-
- -
-
-
-
-
-

- 1. Select which database option best fits you:

+ To complete this step you will either need a blank database or, if you do not have a blank database available, choose the SQL CE 4 embedded + database (This is the recommended approach for first time users or if you are unsure). +

+

+ If you are not using the SQL CE 4 embedded database you will need the connection details for your database, such as the + "connection string". You may need to contact your system administrator or web host for this information. +

+
+ +
+ +
+
+
+

+ 1. Select which database option best fits you: +

    -
  • - - +
  • + + -
  • -
  • - - +
  • +
  • + + -
  • -
  • - - +
  • +
  • + + -
  • -
  • - - +
  • +
  • + + -
  • +
- -
-
- -
- - -
- -
-
-

- 2. Now choose your database type below.

-
- - - - - - - -
-
-
- - -
-
-

- 3. Connection details: Please fill out the connection information for your database.

-
- - - -
-

- -

-
- -
-
- Server: - - -
-
- Database name: - - -
-
- Username: - - -
-
- Password: - - -
- -
-
- - -
-
- - -
-
-
- -

- 2. Simple file-based database:

-
- - - - -
-
- -
-
-
-

- 2. Connection details: Please fill out the connection information for your database.

+ +
-
- -
- Connection string: - - -
-
+ + +
+ +
+

- Example: datalayer=MySQL;server=192.168.2.8;user id=user;password=***;database=umbraco

-
+ 2. Now choose your database type below. +

+
+ + + + + + +
+
+ + +
+
+

+ 3. Connection details: Please fill out the connection information for your database. +

+
+ + + +
+

+ + +

+
+ +
+
+ Server: + + +
+
+ Database name: + + +
+
+ Username: + + +
+
+ Password: + + +
+ +
+
+ +
-
- -
-
-
-

- 2. Getting a database setup for umbraco.
- For first time users, we recommend you select "quick-and-simple embedded database". + +

+
+
+ +

+ 2. Simple file-based database: +

+
+ + + + +
+
+
+
+ +
+
+
+

+ 2. Connection details: Please fill out the connection information for your database. +

+ +
+ +
+ Connection string: + + +
+
+

+ Example: datalayer=MySQL;server=192.168.2.8;user id=user;password=***;database=umbraco +

+
+ +
+
+
+
+ + +
+
+
+

+ 2. Getting a database setup for umbraco.
+ For first time users, we recommend you select "quick-and-simple embedded database". This will install an easy to use database, that does not require any additional software to use.
- Alternatively, you can install Microsoft SQL Server, which will require a bit more + Alternatively, you can install Microsoft SQL Server, which will require a bit more work to get up and running.
- We have provided a step-by-step guide in the video instructions below. -

- Open video instructions + We have provided a step-by-step guide in the video instructions below. +

+ Open video instructions +
+ +
+
 
+ install +
+
-
-
 
- install -
- -
- -
- -
-
- - -
-
-

- Installing Umbraco

-

- The Umbraco database is being configured. This process populates your chosen database with a blank Umbraco instance.

-
-
-
-
- 0% -
- -
-
- -
-
 
- Continue - -
-
+ +
+
+

Installing Umbraco

+

+ The Umbraco database is being configured. This process populates your chosen database with a blank Umbraco instance. +

+
+
+
+
+ 0% +
+ +
+
+ +
+
 
+ Continue + +
+
- + if (data.Percentage == 100) { + clearInterval(intervalId); + jQuery(".btn-box").show(); + jQuery('.ui-progressbar-value').css("background-image", "url(../umbraco_client/installer/images/pbar.gif)"); + } + }); + } +
- -

- Database installed

-
-

- Umbraco + +

Database installed

+
+

+ Umbraco <%=umbraco.GlobalSettings.CurrentVersion%> - has now been copied to your database. Press Continue to proceed.

-
- - -

- Database upgraded

-
-

- Your database has been upgraded to version: + has now been copied to your database. Press Continue to proceed. +

+
+
+ +

Database upgraded

+
+

+ Your database has been upgraded to version: <%=umbraco.GlobalSettings.CurrentVersion%>.
- Press Continue to proceed. -

-
-
- -
-
 
- Continue -
+ Press Continue to proceed. +

+
+
+ +
+
 
+ Continue +
diff --git a/src/Umbraco.Web/umbraco.presentation/install/utills/Helper.cs b/src/Umbraco.Web/umbraco.presentation/install/utills/Helper.cs index 119794976e..7a48656387 100644 --- a/src/Umbraco.Web/umbraco.presentation/install/utills/Helper.cs +++ b/src/Umbraco.Web/umbraco.presentation/install/utills/Helper.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Web; +using System.Web.Script.Serialization; using System.Web.UI; namespace umbraco.presentation.install { @@ -43,13 +44,28 @@ namespace umbraco.presentation.install { } public static string getProgress(){ - string json = @"{ - 'percentage': '%p', - 'message': '%m', - 'error': '%e' - }"; - string retval = json.Replace("%p", Percentage.ToString()).Replace("%m", Description).Replace("%e", Error).Replace("'", "\""); - return retval; + ProgressResult pr = new ProgressResult(Percentage, Description, Error); + JavaScriptSerializer js = new JavaScriptSerializer(); + return js.Serialize(pr); } } + + public class ProgressResult + { + public string Error { get; set; } + public int Percentage { get; set; } + public string Description { get; set; } + public ProgressResult() + { + + } + + public ProgressResult(int percentage, string description, string error) + { + Percentage = percentage; + Description = description; + Error = error; + } + + } } \ No newline at end of file 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 01ccfa6261..67fb8c6d78 100644 --- a/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs @@ -41,7 +41,7 @@ namespace umbraco.presentation.install.utills string XmlResponse = library.GetXmlDocumentByUrl(url).Current.OuterXml; - if(!XmlResponse.Contains("System.Net.WebException")) + if (!XmlResponse.Contains("System.Net.WebException")) { Response.Write(library.GetXmlDocumentByUrl(url).Current.OuterXml); } @@ -63,7 +63,7 @@ namespace umbraco.presentation.install.utills // Build the new connection string //DbConnectionStringBuilder connectionStringBuilder = CreateConnectionString(); - Helper.setProgress( 5, "Connecting...", ""); + Helper.setProgress(5, "Connecting...", ""); // Try to connect to the database try @@ -74,12 +74,13 @@ namespace umbraco.presentation.install.utills if (!installer.CanConnect) throw new Exception("The installer cannot connect to the database."); else - Helper.setProgress( 20, "Connection opened", ""); + Helper.setProgress(20, "Connection opened", ""); } catch (Exception ex) { var error = new Exception("Database connection initialisation failed.", ex); - Helper.setProgress( -5, "Database connection initialisation failed.", error.Message); + Helper.setProgress(-5, "Database connection initialisation failed.", + string.Format("{0}
Connection string: {1}", error.InnerException.Message, GlobalSettings.DbDSN)); return error.Message; } @@ -87,49 +88,60 @@ namespace umbraco.presentation.install.utills if (installer.CanConnect) { - if (installer.IsLatestVersion) { + if (installer.IsLatestVersion) + { - Helper.setProgress(90, "Refreshing content cache", ""); + Helper.setProgress(90, "Refreshing content cache", ""); - library.RefreshContent(); + library.RefreshContent(); - Helper.setProgress(100, "Database is up-to-date", ""); - - } else { - if (installer.IsEmpty) { - Helper.setProgress(35, "Installing tables...", ""); - //do install - installer.Install(); + Helper.setProgress(100, "Database is up-to-date", ""); - Helper.setProgress(100, "Installation completed!", ""); + } + else + { + if (installer.IsEmpty) + { + Helper.setProgress(35, "Installing tables...", ""); + //do install + try + { + installer.Install(); + Helper.setProgress(100, "Installation completed!", ""); + installer = null; - installer = null; + library.RefreshContent(); + return "installed"; + } + catch (Exception SqlExp) + { + Helper.setProgress(35, "Error installing tables", SqlExp.InnerException.ToString()); + return "error"; + } + + } //else if (m_Installer.CurrentVersion == DatabaseVersion.None || m_Installer.CanUpgrade) { + //Helper.setProgress(35, "Updating database tables...", ""); + //m_Installer.Install(); - library.RefreshContent(); - return "installed"; - } //else if (m_Installer.CurrentVersion == DatabaseVersion.None || m_Installer.CanUpgrade) { - //Helper.setProgress(35, "Updating database tables...", ""); - //m_Installer.Install(); - - // library.RefreshContent(); - // return "installed"; - // } + // library.RefreshContent(); + // return "installed"; + // } else if (installer.CurrentVersion == DatabaseVersion.None || installer.CanUpgrade) { - Helper.setProgress( 35, "Updating database tables...", ""); + Helper.setProgress(35, "Updating database tables...", ""); installer.Install(); - Helper.setProgress(100, "Upgrade completed!", ""); + Helper.setProgress(100, "Upgrade completed!", ""); - installer = null; + installer = null; - library.RefreshContent(); - return "upgraded"; + library.RefreshContent(); + return "upgraded"; + } } - } - - + + } return "no connection;";