From 663995eac7b8e0f3cb53b559d8afb6d95879e0b3 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Mon, 31 Oct 2011 14:40:09 +0100 Subject: [PATCH] Added support for MySQL 5.5. All changes has been found on Sourceforge/WSP forums --- WebsitePanel/Database/install_db.sql | 12 +++ ...sitePanel.Providers.DNS.SimpleDNS50.csproj | 2 +- .../MySqlServer55.cs | 83 +++++++++++++++++++ ...bsitePanel.Providers.Database.MySQL.csproj | 1 + ...bsitePanel.Providers.HostedSolution.csproj | 14 ++-- 5 files changed, 104 insertions(+), 8 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer55.cs diff --git a/WebsitePanel/Database/install_db.sql b/WebsitePanel/Database/install_db.sql index 35401f46..6f7892d9 100644 --- a/WebsitePanel/Database/install_db.sql +++ b/WebsitePanel/Database/install_db.sql @@ -17391,6 +17391,8 @@ INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName] GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (300, 30, N'HyperV', N'Microsoft Hyper-V', N'WebsitePanel.Providers.Virtualization.HyperV, WebsitePanel.Providers.Virtualization.HyperV', N'HyperV', 1) GO +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (301, 11, N'MySQL', N'MySQL Server 5.5', N'WebsitePanel.Providers.Database.MySqlServer55, WebsitePanel.Providers.Database.MySQL', N'MySQL', NULL) +GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (400, 40, N'HyperVForPC', N'Microsoft Hyper-V For Private Cloud', N'WebsitePanel.Providers.VirtualizationForPC.HyperVForPC, WebsitePanel.Providers.VirtualizationForPC.HyperVForPC', N'HyperVForPrivateCloud', 1) GO SET ANSI_NULLS ON @@ -30791,6 +30793,16 @@ INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [Property GO INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'VirtualDiskType', N'dynamic') GO +INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'ExternalAddress', N'localhost') +GO +INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'InstallFolder', N'%PROGRAMFILES%\MySQL\MySQL Server 5.5') +GO +INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'InternalAddress', N'localhost,3306') +GO +INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'RootLogin', N'root') +GO +INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (301, N'RootPassword', N'') +GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.DNS.SimpleDNS50/WebsitePanel.Providers.DNS.SimpleDNS50.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.DNS.SimpleDNS50/WebsitePanel.Providers.DNS.SimpleDNS50.csproj index 8466a88d..7a329d37 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.DNS.SimpleDNS50/WebsitePanel.Providers.DNS.SimpleDNS50.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.DNS.SimpleDNS50/WebsitePanel.Providers.DNS.SimpleDNS50.csproj @@ -56,7 +56,7 @@ - ..\..\Lib\References\SimpleDNS\SDNSAPI.dll + ..\..\..\..\..\WebsitePanel.bak\WebsitePanel\Branches\1.2.0\Lib\References\SimpleDNS\SDNSAPI.dll diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer55.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer55.cs new file mode 100644 index 00000000..13599499 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer55.cs @@ -0,0 +1,83 @@ +// Copyright (c) 2010, SMB SAAS Systems Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the SMB SAAS Systems Inc. nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Data; +using Microsoft.Win32; +using MySql.Data.MySqlClient; +using System.IO; + +using WebsitePanel.Server.Utils; +using WebsitePanel.Providers.Utils; +using WebsitePanel.Providers; +using System.Reflection; + +namespace WebsitePanel.Providers.Database +{ + public class MySqlServer55 : MySqlServer + { + + public MySqlServer55() + { + + } + + public override bool IsInstalled() + { + string versionNumber = null; + + RegistryKey HKLM = Registry.LocalMachine; + + RegistryKey key = HKLM.OpenSubKey(@"SOFTWARE\MySQL AB\MySQL Server 5.5"); + + if (key != null) + { + versionNumber = (string)key.GetValue("Version"); + } + else + { + key = HKLM.OpenSubKey(@"SOFTWARE\Wow6432Node\MySQL AB\MySQL Server 5.5"); + if (key != null) + { + versionNumber = (string)key.GetValue("Version"); + } + else + { + return false; + } + } + + string[] split = versionNumber.Split(new char[] { '.' }); + + return split[0].Equals("5") & split[1].Equals("5"); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/WebsitePanel.Providers.Database.MySQL.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/WebsitePanel.Providers.Database.MySQL.csproj index 0141633a..7b610d19 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/WebsitePanel.Providers.Database.MySQL.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/WebsitePanel.Providers.Database.MySQL.csproj @@ -70,6 +70,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj index 22cf0367..70640894 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj @@ -80,31 +80,31 @@ False - ..\..\Lib\References\Microsoft\v14\Microsoft.Exchange.Common.dll + ..\..\..\..\..\WebsitePanel.bak\WebsitePanel\Branches\1.2.0\Lib\References\Microsoft\Microsoft.Exchange.Common.dll False - ..\..\Lib\References\Microsoft\v14\Microsoft.Exchange.Data.dll + ..\..\..\..\..\WebsitePanel.bak\WebsitePanel\Branches\1.2.0\Lib\References\Microsoft\Microsoft.Exchange.Data.dll False - ..\..\Lib\References\Microsoft\v14\Microsoft.Exchange.Data.Directory.dll + ..\..\..\..\..\WebsitePanel.bak\WebsitePanel\Branches\1.2.0\Lib\References\Microsoft\Microsoft.Exchange.Data.Directory.dll False - ..\..\Lib\References\Microsoft\v14\Microsoft.Exchange.Data.Storage.dll + ..\..\..\..\..\WebsitePanel.bak\WebsitePanel\Branches\1.2.0\Lib\References\Microsoft\Microsoft.Exchange.Data.Storage.dll False - ..\..\Lib\References\Microsoft\v14\Microsoft.Exchange.Diagnostics.dll + ..\..\..\..\..\WebsitePanel.bak\WebsitePanel\Branches\1.2.0\Lib\References\Microsoft\Microsoft.Exchange.Diagnostics.dll False - ..\..\Lib\References\Microsoft\v14\Microsoft.Exchange.Extensibility.Internal.dll + ..\..\..\..\..\WebsitePanel.bak\WebsitePanel\Branches\1.2.0\Lib\References\Microsoft\Microsoft.Exchange.Extensibility.Internal.dll False - ..\..\Lib\References\Microsoft\v14\Microsoft.Exchange.Net.dll + ..\..\..\..\..\WebsitePanel.bak\WebsitePanel\Branches\1.2.0\Lib\References\Microsoft\Microsoft.Exchange.Net.dll ..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll