diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Actions/EntServerActionManager.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Actions/EntServerActionManager.cs index 6952cf21..10dc21e2 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Actions/EntServerActionManager.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Actions/EntServerActionManager.cs @@ -28,6 +28,9 @@ using System; using System.Collections.Generic; +using System.Configuration.Install; +using System.Linq; +using System.ServiceProcess; using System.Text; using System.IO; using System.Xml; @@ -99,6 +102,74 @@ namespace WebsitePanel.Setup.Actions } } + public class InstallSchedulerServiceAction : Action, IInstallAction, IUninstallAction + { + public const string LogStartInstallMessage = "Installing Scheduler Windows Service..."; + public const string LogStartUninstallMessage = "Uninstalling Scheduler Windows Service..."; + + void IInstallAction.Run(SetupVariables vars) + { + try + { + + Begin(LogStartInstallMessage); + + Log.WriteStart(LogStartInstallMessage); + Log.WriteInfo(String.Format("Scheduler Service Name: \"{0}\"", Global.Parameters.SchedulerServiceName)); + + if (ServiceController.GetServices().Any(s => s.DisplayName.Equals(Global.Parameters.SchedulerServiceName, StringComparison.CurrentCultureIgnoreCase))) + { + Log.WriteEnd("Scheduler Service Already Installed."); + InstallLog.AppendLine(String.Format("- Scheduler Service \"{0}\" Already Installed.", Global.Parameters.SchedulerServiceName)); + return; + } + + ManagedInstallerClass.InstallHelper(new[] {"/i", Path.Combine(vars.InstallationFolder, "bin", Global.Parameters.SchedulerServiceFileName)}); + Utils.StartService(Global.Parameters.SchedulerServiceName); + } + catch (Exception ex) + { + UninstallService(vars); + + if (Utils.IsThreadAbortException(ex)) + { + return; + } + + Log.WriteError("Installing scheduler service error.", ex); + throw; + } + } + + void IUninstallAction.Run(SetupVariables vars) + { + try + { + Log.WriteStart(LogStartUninstallMessage); + UninstallService(vars); + Log.WriteEnd("Scheduler Service Uninstalled."); + } + catch (Exception ex) + { + if (Utils.IsThreadAbortException(ex)) + { + return; + } + + Log.WriteError("Uninstalling scheduler service error.", ex); + throw; + } + } + + private void UninstallService(SetupVariables vars) + { + if (ServiceController.GetServices().Any(s => s.ServiceName.Equals(Global.Parameters.SchedulerServiceName, StringComparison.CurrentCultureIgnoreCase))) + { + ManagedInstallerClass.InstallHelper(new[] { "/u", Path.Combine(vars.InstallationFolder, "bin", Global.Parameters.SchedulerServiceFileName) }); + } + } + } + public class CreateDatabaseAction : Action, IInstallAction, IUninstallAction { public const string LogStartInstallMessage = "Creating SQL Server database..."; @@ -348,6 +419,31 @@ namespace WebsitePanel.Setup.Actions } } + public class SaveSchedulerServiceConnectionStringAction : Action, IInstallAction + { + void IInstallAction.Run(SetupVariables vars) + { + Log.WriteStart(string.Format("Updating {0}.config file (connection string)", Global.Parameters.SchedulerServiceFileName)); + var file = Path.Combine(vars.InstallationFolder, "bin", string.Format("{0}.config", Global.Parameters.SchedulerServiceFileName)); + string content; + + using (var reader = new StreamReader(file)) + { + content = reader.ReadToEnd(); + } + + vars.ConnectionString = String.Format(vars.ConnectionString, vars.DatabaseServer, vars.Database, vars.Database, vars.DatabaseUserPassword); + content = Utils.ReplaceScriptVariable(content, "installer.connectionstring", vars.ConnectionString); + + using (var writer = new StreamWriter(file)) + { + writer.Write(content); + } + + Log.WriteEnd(string.Format("Updated {0}.config file (connection string)", Global.Parameters.SchedulerServiceFileName)); + } + } + public class SaveEntServerConfigSettingsAction : Action, IInstallAction { void IInstallAction.Run(SetupVariables vars) @@ -390,7 +486,9 @@ namespace WebsitePanel.Setup.Actions new UpdateServeradminPasswAction(), new SaveAspNetDbConnectionStringAction(), new SaveComponentConfigSettingsAction(), - new SaveEntServerConfigSettingsAction() + new SaveEntServerConfigSettingsAction(), + new SaveSchedulerServiceConnectionStringAction(), + new InstallSchedulerServiceAction() }; public EntServerActionManager(SetupVariables sessionVars) : base(sessionVars) diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/Global.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/Global.cs index 52affc1e..8eda1436 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/Global.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/Global.cs @@ -77,6 +77,8 @@ namespace WebsitePanel.Setup public const string ConnectionString = "ConnectionString"; public const string InstallConnectionString = "InstallConnectionString"; public const string Release = "Release"; + public const string SchedulerServiceFileName = "WebsitePanel.SchedulerService.exe"; + public const string SchedulerServiceName = "WebsitePanel Scheduler"; } public abstract class Messages diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/WebsitePanel.Setup.csproj b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/WebsitePanel.Setup.csproj index 6b9d839d..f8a058bc 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/WebsitePanel.Setup.csproj +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/WebsitePanel.Setup.csproj @@ -74,6 +74,7 @@ + diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Wizard/UninstallPage.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Wizard/UninstallPage.cs index f9e34dfa..19cecdb9 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Wizard/UninstallPage.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Wizard/UninstallPage.cs @@ -27,11 +27,14 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Configuration.Install; using System.IO; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; +using System.Linq; +using System.ServiceProcess; using System.Text; using System.Threading; using System.Windows.Forms; @@ -208,17 +211,19 @@ namespace WebsitePanel.Setup Log.WriteError("Windows service stop error", ex); } - int exitCode = Utils.RunProcess(path, "/u"); - if (exitCode == 0) - { - Log.WriteEnd("Removed Windows service"); - InstallLog.AppendLine(string.Format("- Removed \"{0}\" Windows service", serviceName)); - } - else - { - Log.WriteError(string.Format("Unable to remove \"{0}\" Windows service. Error code: {1}", serviceName, exitCode), null); - InstallLog.AppendLine(string.Format("- Failed to remove \"{0}\" Windows service", serviceName)); - } + try + { + ManagedInstallerClass.InstallHelper(new[] {"/u", path}); + } + catch(Exception) + { + Log.WriteError(string.Format("Unable to remove \"{0}\" Windows service.", serviceName), null); + InstallLog.AppendLine(string.Format("- Failed to remove \"{0}\" Windows service", serviceName)); + throw; + } + + Log.WriteEnd("Removed Windows service"); + InstallLog.AppendLine(string.Format("- Removed \"{0}\" Windows service", serviceName)); } catch (Exception ex) { @@ -268,7 +273,7 @@ namespace WebsitePanel.Setup internal List GetUninstallActions(string componentId) { - List list = new List(); + var list = new List(); InstallAction action = null; //windows service @@ -285,6 +290,12 @@ namespace WebsitePanel.Setup list.Add(action); } + if (ServiceController.GetServices().Any(s => s.DisplayName.Equals(Global.Parameters.SchedulerServiceName, StringComparison.CurrentCultureIgnoreCase))) + { + action = new InstallAction(ActionTypes.UnregisterWindowsService) {Path = Path.Combine(installFolder, "bin", Global.Parameters.SchedulerServiceFileName), Name = Global.Parameters.SchedulerServiceName, Description = "Removing Windows service..."}; + action.Log = string.Format("- Remove {0} Windows service", action.Name); + list.Add(action); + } //database bool deleteDatabase = AppConfig.GetComponentSettingBooleanValue(componentId, "NewDatabase"); diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/WebsitePanel.Import.Enterprise.csproj b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/WebsitePanel.Import.Enterprise.csproj index 46b74405..32738387 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/WebsitePanel.Import.Enterprise.csproj +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/WebsitePanel.Import.Enterprise.csproj @@ -74,6 +74,9 @@ ..\..\..\Bin\WebsitePanel.EnterpriseServer.Client.dll + + ..\..\..\Bin\WebsitePanel.EnterpriseServer.Code.dll + ..\..\..\Bin\WebsitePanel.Providers.Base.dll diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj index dc0532b3..49de1bd3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj @@ -17,7 +17,7 @@ true full false - bin\Debug\ + ..\..\Bin\ DEBUG;TRACE prompt 4 @@ -52,7 +52,8 @@ ..\..\Bin\WebsitePanel.Common.Utils.dll - + + False ..\..\Bin\WebsitePanel.EnterpriseServer.Base.dll diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.sln b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.sln index 62776c21..5996e6ba 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.sln +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2010 +# Visual Studio 2012 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C57D3F9F-7BA0-4D38-A159-B6EDA5C19B13}" ProjectSection(SolutionItems) = preProject ..\..\LICENSE.txt = ..\..\LICENSE.txt @@ -10,6 +10,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.EnterpriseServer", "WebsitePanel.EnterpriseServer\WebsitePanel.EnterpriseServer.csproj", "{59C7623A-5181-48A5-880A-C9B82B48F589}" + ProjectSection(ProjectDependencies) = postProject + {C09CE910-F16B-48A1-B2CC-C99B8C1CF775} = {C09CE910-F16B-48A1-B2CC-C99B8C1CF775} + {60E39314-659C-4FAD-AB91-D0D08E223578} = {60E39314-659C-4FAD-AB91-D0D08E223578} + {4B344644-A570-477E-ADCC-F2B267D6C038} = {4B344644-A570-477E-ADCC-F2B267D6C038} + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.EnterpriseServer.Base", "WebsitePanel.EnterpriseServer.Base\WebsitePanel.EnterpriseServer.Base.csproj", "{C09CE910-F16B-48A1-B2CC-C99B8C1CF775}" EndProject @@ -21,12 +26,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Plugins.Author EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Plugins.PayPalPro", "WebsitePanel.Gateways.PayPal\WebsitePanel.Plugins.PayPalPro.csproj", "{D695D58C-99F7-409E-B3D8-C1B97A8E748A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Products.DomainName", "WebsitePanel.Products.DomainName\WebsitePanel.Products.DomainName.csproj", "{FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Products.HostingAddon", "WebsitePanel.Products.HostingAddon\WebsitePanel.Products.HostingAddon.csproj", "{338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Products.HostingPlan", "WebsitePanel.Products.HostingPlan\WebsitePanel.Products.HostingPlan.csproj", "{65FEDD1B-379C-413D-84D8-20E6C29C645D}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Plugins.Enom", "WebsitePanel.Registrars.Enom\WebsitePanel.Plugins.Enom.csproj", "{39A6F585-4A27-4AAA-A43F-858FC32ADF98}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Common.Utils", "WebsitePanel.Common.Utils\WebsitePanel.Common.Utils.csproj", "{53D22D35-4013-415F-BA09-F67A0DBBB0C1}" @@ -42,6 +41,9 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Templates", "WebsitePanel.Templates\WebsitePanel.Templates.csproj", "{387FA0EF-3927-45FF-8F8F-BCCD735540C6}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.EnterpriseServer.Code", "WebsitePanel.EnterpriseServer.Code\WebsitePanel.EnterpriseServer.Code.csproj", "{60E39314-659C-4FAD-AB91-D0D08E223578}" + ProjectSection(ProjectDependencies) = postProject + {C09CE910-F16B-48A1-B2CC-C99B8C1CF775} = {C09CE910-F16B-48A1-B2CC-C99B8C1CF775} + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.SchedulerService", "WebsitePanel.SchedulerService\WebsitePanel.SchedulerService.csproj", "{5B823520-0450-44A9-AC86-9658B41DFA7C}" EndProject @@ -115,30 +117,6 @@ Global {D695D58C-99F7-409E-B3D8-C1B97A8E748A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {D695D58C-99F7-409E-B3D8-C1B97A8E748A}.Release|Mixed Platforms.Build.0 = Release|Any CPU {D695D58C-99F7-409E-B3D8-C1B97A8E748A}.Release|x86.ActiveCfg = Release|Any CPU - {FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}.Debug|x86.ActiveCfg = Debug|Any CPU - {FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FFE9BFD3-AAB8-4703-AF8F-A41F0D878DB8}.Release|x86.ActiveCfg = Release|Any CPU - {338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}.Debug|x86.ActiveCfg = Debug|Any CPU - {338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {338F816B-BEB4-4F18-9EA1-2EFD35DBA65B}.Release|x86.ActiveCfg = Release|Any CPU - {65FEDD1B-379C-413D-84D8-20E6C29C645D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65FEDD1B-379C-413D-84D8-20E6C29C645D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {65FEDD1B-379C-413D-84D8-20E6C29C645D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {65FEDD1B-379C-413D-84D8-20E6C29C645D}.Debug|x86.ActiveCfg = Debug|Any CPU - {65FEDD1B-379C-413D-84D8-20E6C29C645D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65FEDD1B-379C-413D-84D8-20E6C29C645D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {65FEDD1B-379C-413D-84D8-20E6C29C645D}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {65FEDD1B-379C-413D-84D8-20E6C29C645D}.Release|x86.ActiveCfg = Release|Any CPU {39A6F585-4A27-4AAA-A43F-858FC32ADF98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {39A6F585-4A27-4AAA-A43F-858FC32ADF98}.Debug|Any CPU.Build.0 = Debug|Any CPU {39A6F585-4A27-4AAA-A43F-858FC32ADF98}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -220,13 +198,13 @@ Global {60E39314-659C-4FAD-AB91-D0D08E223578}.Release|Mixed Platforms.Build.0 = Release|Any CPU {60E39314-659C-4FAD-AB91-D0D08E223578}.Release|x86.ActiveCfg = Release|Any CPU {5B823520-0450-44A9-AC86-9658B41DFA7C}.Debug|Any CPU.ActiveCfg = Debug|x86 - {5B823520-0450-44A9-AC86-9658B41DFA7C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {5B823520-0450-44A9-AC86-9658B41DFA7C}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {5B823520-0450-44A9-AC86-9658B41DFA7C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5B823520-0450-44A9-AC86-9658B41DFA7C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {5B823520-0450-44A9-AC86-9658B41DFA7C}.Debug|x86.ActiveCfg = Debug|x86 {5B823520-0450-44A9-AC86-9658B41DFA7C}.Debug|x86.Build.0 = Debug|x86 {5B823520-0450-44A9-AC86-9658B41DFA7C}.Release|Any CPU.ActiveCfg = Release|x86 - {5B823520-0450-44A9-AC86-9658B41DFA7C}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {5B823520-0450-44A9-AC86-9658B41DFA7C}.Release|Mixed Platforms.Build.0 = Release|x86 + {5B823520-0450-44A9-AC86-9658B41DFA7C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5B823520-0450-44A9-AC86-9658B41DFA7C}.Release|Mixed Platforms.Build.0 = Release|Any CPU {5B823520-0450-44A9-AC86-9658B41DFA7C}.Release|x86.ActiveCfg = Release|x86 {5B823520-0450-44A9-AC86-9658B41DFA7C}.Release|x86.Build.0 = Release|x86 EndGlobalSection diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index d5f08cc5..7a73a914 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,7 +5,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj index 9bd21981..605e542d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj @@ -70,6 +70,9 @@ ..\..\Bin\WebsitePanel.EnterpriseServer.Base.dll + + ..\..\Bin\WebsitePanel.EnterpriseServer.Code.dll + ..\..\Bin\WebsitePanel.Providers.Base.dll @@ -266,12 +269,6 @@ - - - {60E39314-659C-4FAD-AB91-D0D08E223578} - WebsitePanel.EnterpriseServer.Code - - @@ -283,7 +280,6 @@ - 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WsePolicyCache.Config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WsePolicyCache.Config index 9e3b5477..a57b49a4 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WsePolicyCache.Config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WsePolicyCache.Config @@ -1,6 +1,6 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.SchedulerService/SchedulerService.cs b/WebsitePanel/Sources/WebsitePanel.SchedulerService/SchedulerService.cs index fb71ca52..be2e8579 100644 --- a/WebsitePanel/Sources/WebsitePanel.SchedulerService/SchedulerService.cs +++ b/WebsitePanel/Sources/WebsitePanel.SchedulerService/SchedulerService.cs @@ -1,23 +1,10 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Linq; -using System.ServiceProcess; -using System.Text; -using System.Timers; +using System.ServiceProcess; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.SchedulerService { public partial class SchedulerService : ServiceBase { - #region Properties - - public Timer _Timer { get; protected set; } - - #endregion - #region Construcor public SchedulerService() @@ -31,17 +18,9 @@ namespace WebsitePanel.SchedulerService protected override void OnStart(string[] args) { - } - - protected override void OnStop() - { - _Timer.Dispose(); - } - - protected void Porcess(object state) - { + Scheduler.Start(); } #endregion } -} +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.SchedulerService/SchedulerServiceInstaller.cs b/WebsitePanel/Sources/WebsitePanel.SchedulerService/SchedulerServiceInstaller.cs new file mode 100644 index 00000000..6d321a24 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.SchedulerService/SchedulerServiceInstaller.cs @@ -0,0 +1,28 @@ +using System.ComponentModel; +using System.Configuration.Install; +using System.ServiceProcess; + +namespace WebsitePanel.SchedulerService +{ + [RunInstaller(true)] + public class SchedulerServiceInstaller : Installer + { + #region Constructor + + public SchedulerServiceInstaller() + { + var processInstaller = new ServiceProcessInstaller(); + var serviceInstaller = new ServiceInstaller(); + + processInstaller.Account = ServiceAccount.LocalSystem; + serviceInstaller.DisplayName = "WebsitePanel Scheduler"; + serviceInstaller.StartType = ServiceStartMode.Automatic; + serviceInstaller.ServiceName = "WebsitePanlel Scheduler"; + + Installers.Add(processInstaller); + Installers.Add(serviceInstaller); + } + + #endregion + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.SchedulerService/WebsitePanel.SchedulerService.csproj b/WebsitePanel/Sources/WebsitePanel.SchedulerService/WebsitePanel.SchedulerService.csproj index 9a22ddd0..475ed6fe 100644 --- a/WebsitePanel/Sources/WebsitePanel.SchedulerService/WebsitePanel.SchedulerService.csproj +++ b/WebsitePanel/Sources/WebsitePanel.SchedulerService/WebsitePanel.SchedulerService.csproj @@ -11,7 +11,8 @@ WebsitePanel.SchedulerService WebsitePanel.SchedulerService v4.0 - Client + + 512 @@ -33,8 +34,27 @@ prompt 4 + + true + ..\WebsitePanel.EnterpriseServer\bin\ + DEBUG;TRACE + full + AnyCPU + prompt + MinimumRecommendedRules.ruleset + + + ..\WebsitePanel.EnterpriseServer\bin\ + TRACE + true + pdbonly + AnyCPU + prompt + MinimumRecommendedRules.ruleset + + @@ -52,6 +72,9 @@ SchedulerService.cs + + Component + @@ -59,6 +82,9 @@ WebsitePanel.EnterpriseServer.Code + + +