├── Topshelf.snk ├── src ├── Topshelf │ ├── packages.config │ ├── Caching │ │ ├── KeySelector.cs │ │ ├── MissingValueProvider.cs │ │ └── CacheItemCallback.cs │ ├── Logging │ │ ├── TypeExtensions.cs │ │ ├── HostLoggerConfigurator.cs │ │ ├── LogWriterFactory.cs │ │ ├── LogWriterOutputProvider.cs │ │ ├── TraceHostLoggerConfigurator.cs │ │ └── TopshelfConsoleTraceListener.cs │ ├── HostStopContext.cs │ ├── HostStartedContext.cs │ ├── HostStoppedContext.cs │ ├── Configuration │ │ ├── CommandLineParser │ │ │ ├── ICommandLineElement.cs │ │ │ ├── ITokenElement.cs │ │ │ ├── IArgumentElement.cs │ │ │ ├── ISwitchElement.cs │ │ │ ├── IDefinitionElement.cs │ │ │ ├── Parser.cs │ │ │ ├── Result.cs │ │ │ ├── AbstractParser.cs │ │ │ ├── ArgumentElement.cs │ │ │ └── TokenElement.cs │ │ ├── Builders │ │ │ ├── EnvironmentBuilder.cs │ │ │ ├── ServiceBuilder.cs │ │ │ ├── HostBuilder.cs │ │ │ ├── StopBuilder.cs │ │ │ └── CommandBuilder.cs │ │ ├── Options │ │ │ ├── Option.cs │ │ │ ├── LocalSystemOption.cs │ │ │ ├── InteractiveOption.cs │ │ │ ├── DisabledOption.cs │ │ │ ├── ManualStartOption.cs │ │ │ ├── AutostartOption.cs │ │ │ ├── DelayedOption.cs │ │ │ ├── LocalServiceOption.cs │ │ │ ├── NetworkServiceOption.cs │ │ │ ├── SystemOnlyHelpOption.cs │ │ │ ├── DisplayNameOption.cs │ │ │ ├── SudoOption.cs │ │ │ ├── ServiceNameOption.cs │ │ │ ├── UnknownOption.cs │ │ │ ├── RunOption.cs │ │ │ ├── ServiceDescriptionOption.cs │ │ │ ├── HelpOption.cs │ │ │ ├── StartOption.cs │ │ │ ├── StopOption.cs │ │ │ ├── InstallOption.cs │ │ │ ├── UninstallOption.cs │ │ │ ├── ServiceAccountOption.cs │ │ │ ├── InstanceOption.cs │ │ │ └── CommandOption.cs │ │ ├── HostConfigurators │ │ │ ├── EnvironmentBuilderFactory.cs │ │ │ ├── ServiceBuilderFactory.cs │ │ │ ├── HostBuilderFactory.cs │ │ │ ├── CommandLineConfigurator.cs │ │ │ ├── HostBuilderConfigurator.cs │ │ │ ├── StartConfigurator.cs │ │ │ ├── SystemOnlyHelpHostConfigurator.cs │ │ │ ├── SudoConfigurator.cs │ │ │ ├── UnknownCommandLineOptionHostConfigurator.cs │ │ │ ├── CommandConfigurator.cs │ │ │ ├── RunAsVirtualAccountHostConfigurator.cs │ │ │ ├── RunAsServiceAccountHostConfigurator.cs │ │ │ ├── RunHostConfiguratorAction.cs │ │ │ ├── UninstallHostConfiguratorAction.cs │ │ │ ├── StartModeHostConfigurator.cs │ │ │ ├── DependencyHostConfigurator.cs │ │ │ ├── InstallHostConfiguratorAction.cs │ │ │ ├── CommandLineSwitchConfigurator.cs │ │ │ ├── CommandLineDefinitionConfigurator.cs │ │ │ └── RunAsUserHostConfigurator.cs │ │ ├── Configurators │ │ │ ├── Configurator.cs │ │ │ ├── ValidationResultDisposition.cs │ │ │ ├── ConfigurationResult.cs │ │ │ └── ValidateResult.cs │ │ ├── Credentials.cs │ │ ├── TestHostExtensions.cs │ │ ├── ServiceRecoveryConfiguratorExtensions.cs │ │ ├── ServiceConfigurators │ │ │ ├── ControlServiceConfigurator.cs │ │ │ └── ServiceConfiguratorBase.cs │ │ ├── UninstallHostConfiguratorExtensions.cs │ │ └── Constants │ │ │ └── KnownServiceNames.cs │ ├── Runtime │ │ ├── ServiceFactory.cs │ │ ├── Windows │ │ │ ├── SafeTokenHandle.cs │ │ │ ├── WindowsUserAccessControl.cs │ │ │ ├── SCMHandle.cs │ │ │ ├── ServiceRecoveryAction.cs │ │ │ ├── WindowsHostEnvironmentBuilder.cs │ │ │ ├── RestartServiceRecoveryAction.cs │ │ │ ├── RunProgramRecoveryAction.cs │ │ │ ├── RestartSystemRecoveryAction.cs │ │ │ ├── ServiceRecoveryOptions.cs │ │ │ └── Kernel32.cs │ │ ├── HostStartMode.cs │ │ ├── InstallHostSettings.cs │ │ ├── ServiceEvents.cs │ │ └── EventCallbackList.cs │ ├── PowerEventArguments.cs │ ├── ServiceControl.cs │ ├── SessionChangedArguments.cs │ ├── HostStartContext.cs │ ├── ServiceCustomCommand.cs │ ├── ServicePowerEvent.cs │ ├── ServiceSuspend.cs │ ├── ServiceSessionChange.cs │ ├── Host.cs │ ├── SessionChangeReasonCode.cs │ ├── TopshelfExitCode.cs │ ├── ServiceShutdown.cs │ ├── HostControl.cs │ ├── Exceptions │ │ ├── TopshelfException.cs │ │ ├── ServiceBuilderException.cs │ │ ├── HostConfigurationException.cs │ │ └── ServiceControlException.cs │ └── Hosts │ │ └── HelpHost.cs ├── Topshelf.Log4Net │ ├── app.config │ └── packages.config ├── .nuget │ ├── packages.config │ └── NuGet.Config ├── Topshelf.NLog │ ├── packages.config │ └── NLogConfiguratorExtensions.cs ├── Topshelf.Serilog │ ├── packages.config │ ├── Logging │ │ └── SerilogLogWriterFactory.cs │ └── SerilogConfigurationExtensions.cs ├── SampleTopshelfService │ ├── packages.config │ ├── app.config │ ├── SampleSansInterfaceService.cs │ └── log4net.config ├── Topshelf.Elmah │ ├── packages.config │ ├── ElmahConfigurationExtensions.cs │ └── Logging │ │ └── ElmahLogWriterFactory.cs ├── SampleTopshelfRehabService │ ├── packages.config │ ├── app.config │ ├── log4net.config │ └── Program.cs ├── SampleTopshelfSuperviseService │ ├── packages.config │ ├── app.config │ ├── Program.cs │ ├── log4net.config │ └── PoorlyBehavedService.cs ├── Topshelf.Tests │ ├── packages.config │ └── BeforeStart_Specs.cs ├── Topshelf.Supervise │ ├── Scripting │ │ ├── CommandScriptStepResult.cs │ │ ├── CommandScriptStepArguments.cs │ │ ├── Command.cs │ │ ├── CommandScriptStepAudit.cs │ │ └── CommandScriptStep.cs │ ├── Threading │ │ ├── ScheduledOperationExecuter.cs │ │ ├── OperationExecutor.cs │ │ ├── ScheduledOperation.cs │ │ ├── ScheduledOperationExecuterImpl.cs │ │ ├── Fiber.cs │ │ └── FiberExtensions.cs │ ├── ServiceAvailabilityHost.cs │ ├── ServiceAvailability.cs │ ├── RestartServiceExtensions.cs │ ├── SuperviseConfigurator.cs │ ├── HostControlProxy.cs │ ├── SuperviseServiceConfigurator.cs │ └── SuperviseConfiguratorExtensions.cs ├── Topshelf.Rehab │ ├── AppDomainHostControl.cs │ └── RehabServiceBuilder.cs └── SolutionVersion.cs ├── .gitattributes ├── doc └── source │ ├── troubleshooting │ └── index.rst │ ├── configuration │ ├── index.rst │ └── logging.rst │ ├── installation │ ├── index.rst │ ├── bugs.rst │ ├── prerequisites.rst │ └── install.rst │ ├── overview │ └── index.rst │ └── index.rst ├── CHANGELOG.md ├── .gitignore └── template.nuspec /Topshelf.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arch/Topshelf/develop/Topshelf.snk -------------------------------------------------------------------------------- /src/Topshelf/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | * text=false 3 | -------------------------------------------------------------------------------- /doc/source/troubleshooting/index.rst: -------------------------------------------------------------------------------- 1 | Troubleshooting Topshelf 2 | ======================== 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Topshelf.Log4Net/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Topshelf/Caching/KeySelector.cs: -------------------------------------------------------------------------------- 1 | namespace Topshelf.Caching 2 | { 3 | delegate TKey KeySelector(TValue value); 4 | } -------------------------------------------------------------------------------- /src/.nuget/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Topshelf/Caching/MissingValueProvider.cs: -------------------------------------------------------------------------------- 1 | namespace Topshelf.Caching 2 | { 3 | delegate TValue MissingValueProvider(TKey key); 4 | } -------------------------------------------------------------------------------- /src/Topshelf/Caching/CacheItemCallback.cs: -------------------------------------------------------------------------------- 1 | namespace Topshelf.Caching 2 | { 3 | delegate void CacheItemCallback(TKey key, TValue value); 4 | } -------------------------------------------------------------------------------- /src/Topshelf.NLog/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Topshelf.Log4Net/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Topshelf.Serilog/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/SampleTopshelfService/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Topshelf.Elmah/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/SampleTopshelfRehabService/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/SampleTopshelfSuperviseService/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/SampleTopshelfRehabService/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/SampleTopshelfService/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/SampleTopshelfSuperviseService/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Topshelf v4.0 2 | 3 | * Removed support for .NET < 4.5.2 4 | * Moved build to FAKE 5 | * Using AppVeyor for public builds https://ci.appveyor.com/project/phatboyg/topshelf 6 | * Allow service users to have blank passwords (topshelf#285) via @ianbattersby -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build_output/* 2 | build_artifacts/* 3 | doc/build/* 4 | 5 | nuget.exe 6 | 7 | *.suo 8 | *.user 9 | packages 10 | *.dotCover 11 | *.dotSettings 12 | 13 | .fake 14 | 15 | bin 16 | obj 17 | _ReSharper* 18 | 19 | *.ReSharper 20 | *.cache 21 | *~ 22 | *.swp 23 | *.bak 24 | *.orig 25 | 26 | # osx noise 27 | .DS_Store 28 | Gemfile.lock 29 | -------------------------------------------------------------------------------- /doc/source/configuration/index.rst: -------------------------------------------------------------------------------- 1 | Configuring Topshelf 2 | """""""""""""""""""" 3 | 4 | Once Topshelf has been added to your service, you can configure the service using the Topshelf configuration API. Topshelf uses an internal domain specific language (DSL) for configuration, along with a series of fluent builders. 5 | 6 | .. toctree:: 7 | 8 | quickstart.rst 9 | config_api.rst 10 | logging.rst 11 | -------------------------------------------------------------------------------- /src/Topshelf/Logging/TypeExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Topshelf.Logging 2 | { 3 | using System; 4 | 5 | static class TypeExtensions 6 | { 7 | static readonly TypeNameFormatter _typeNameFormatter = new TypeNameFormatter(); 8 | 9 | 10 | public static string GetTypeName(this Type type) 11 | { 12 | return _typeNameFormatter.GetTypeName(type); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /doc/source/installation/index.rst: -------------------------------------------------------------------------------- 1 | Topshelf Installation 2 | ===================== 3 | 4 | This section of the online docs will explain how to get Topshelf into 5 | your project. It will also show you where to get help, how to report bugs, etc. 6 | Hopefully, you will find it useful as you explore the Topshelf framework. 7 | 8 | .. toctree:: 9 | 10 | prerequisites.rst 11 | install.rst 12 | help.rst 13 | bugs.rst 14 | -------------------------------------------------------------------------------- /doc/source/installation/bugs.rst: -------------------------------------------------------------------------------- 1 | How to report bugs 2 | ================== 3 | 4 | If you run into a bug, please spend a minute collecting the right information 5 | to help us fix the bug. 6 | 7 | The most valuable piece of information you can give us, is always give us a 8 | failing unit test, if you can't give us that then how to reproduce the bug in a 9 | step by step fashion. Other wise its going to be a lot of back and forth until 10 | we can better understand and get to a failing unit test. -------------------------------------------------------------------------------- /doc/source/installation/prerequisites.rst: -------------------------------------------------------------------------------- 1 | Prerequisites 2 | ============= 3 | 4 | Topshelf is a .Net framework for C# and will need a .Net runtime to run on. 5 | 6 | To work with Topshelf you will need to be running on a Windows operating 7 | system. The developers of Topshelf regulary test on Windows 7 and 8 | Windows Server 2008RC2. Though it should still work on Windows Server 2003, as 9 | long as .Net 3.5 sp1 is installed. 10 | 11 | .Net Framework 12 | """""""""""""" 13 | 14 | Currently Topshelf is tested on .NET 3.5 Service Pack 1 and .NET 4.0. 15 | -------------------------------------------------------------------------------- /doc/source/overview/index.rst: -------------------------------------------------------------------------------- 1 | Topshelf Overview 2 | ================= 3 | 4 | Topshelf is a framework for hosting services written using the .NET framework. The creation of services is simplified, allowing developers to create a simple console application that can be installed as a service using Topshelf. The reason for this is simple: It is far easier to debug a console application than a service. And once the application is tested and ready for production, Topshelf makes it easy to install the application as a service. 5 | 6 | .. toctree:: 7 | 8 | faq.rst 9 | commandline.rst 10 | -------------------------------------------------------------------------------- /doc/source/index.rst: -------------------------------------------------------------------------------- 1 | .. Topshelf documentation master file, created by 2 | sphinx-quickstart on Mon Jan 17 15:29:48 2011. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to Topshelf's documentation! 7 | ======================================= 8 | 9 | .. image:: http://topshelf-project.com/slide.1.png 10 | 11 | Contents: 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | 16 | installation/index.rst 17 | configuration/index.rst 18 | overview/index.rst 19 | troubleshooting/index.rst 20 | 21 | 22 | Indices and tables 23 | ================== 24 | 25 | * :ref:`genindex` 26 | * :ref:`modindex` 27 | * :ref:`search` 28 | 29 | -------------------------------------------------------------------------------- /src/Topshelf.Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Topshelf/HostStopContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf 14 | { 15 | public interface HostStopContext : 16 | HostControl 17 | { 18 | } 19 | } -------------------------------------------------------------------------------- /src/Topshelf/HostStartedContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf 14 | { 15 | public interface HostStartedContext : 16 | HostControl 17 | { 18 | } 19 | } -------------------------------------------------------------------------------- /src/Topshelf/HostStoppedContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf 14 | { 15 | public interface HostStoppedContext : 16 | HostControl 17 | { 18 | } 19 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/CommandLineParser/ICommandLineElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.CommandLineParser 14 | { 15 | interface ICommandLineElement 16 | { 17 | } 18 | } -------------------------------------------------------------------------------- /src/Topshelf/Runtime/ServiceFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Runtime 14 | { 15 | public delegate T ServiceFactory(HostSettings settings) 16 | where T : class; 17 | } -------------------------------------------------------------------------------- /src/Topshelf/PowerEventArguments.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2013 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf 14 | { 15 | public interface PowerEventArguments 16 | { 17 | PowerEventCode EventCode { get; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Topshelf/Logging/HostLoggerConfigurator.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Logging 14 | { 15 | public interface HostLoggerConfigurator 16 | { 17 | LogWriterFactory CreateLogWriterFactory(); 18 | } 19 | } -------------------------------------------------------------------------------- /src/Topshelf.Supervise/Scripting/CommandScriptStepResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Supervise.Scripting 14 | { 15 | public class CommandScriptStepResult : 16 | CommandScriptDictionary 17 | { 18 | } 19 | } -------------------------------------------------------------------------------- /src/Topshelf/Runtime/Windows/SafeTokenHandle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Topshelf.Runtime.Windows 4 | { 5 | using System.Runtime.ConstrainedExecution; 6 | using System.Runtime.InteropServices; 7 | using System.Security; 8 | using Microsoft.Win32.SafeHandles; 9 | 10 | public sealed class SafeTokenHandle : SafeHandleZeroOrMinusOneIsInvalid 11 | { 12 | private SafeTokenHandle() 13 | : base(true) { } 14 | 15 | [DllImport("kernel32.dll")] 16 | [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] 17 | [SuppressUnmanagedCodeSecurity] 18 | [return: MarshalAs(UnmanagedType.Bool)] 19 | private static extern bool CloseHandle(IntPtr handle); 20 | 21 | protected override bool ReleaseHandle() 22 | { 23 | return CloseHandle(handle); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Topshelf.Supervise/Scripting/CommandScriptStepArguments.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Supervise.Scripting 14 | { 15 | public class CommandScriptStepArguments : 16 | CommandScriptDictionary 17 | { 18 | } 19 | } -------------------------------------------------------------------------------- /src/Topshelf/Logging/LogWriterFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Logging 14 | { 15 | public interface LogWriterFactory 16 | { 17 | LogWriter Get(string name); 18 | 19 | void Shutdown(); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Topshelf/ServiceControl.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf 14 | { 15 | public interface ServiceControl 16 | { 17 | bool Start(HostControl hostControl); 18 | bool Stop(HostControl hostControl); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/Builders/EnvironmentBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Builders 14 | { 15 | using Runtime; 16 | 17 | public interface EnvironmentBuilder 18 | { 19 | HostEnvironment Build(); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/CommandLineParser/ITokenElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.CommandLineParser 14 | { 15 | interface ITokenElement : 16 | ICommandLineElement 17 | { 18 | string Token { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Topshelf/SessionChangedArguments.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2013 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf 14 | { 15 | public interface SessionChangedArguments 16 | { 17 | SessionChangeReasonCode ReasonCode { get; } 18 | int SessionId { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/CommandLineParser/IArgumentElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.CommandLineParser 14 | { 15 | interface IArgumentElement : 16 | ICommandLineElement 17 | { 18 | string Id { get; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/Options/Option.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Options 14 | { 15 | using HostConfigurators; 16 | 17 | public interface Option 18 | { 19 | void ApplyTo(HostConfigurator configurator); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Topshelf.Supervise/Threading/ScheduledOperationExecuter.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Supervise.Threading 14 | { 15 | interface ScheduledOperationExecuter : 16 | ScheduledOperation 17 | { 18 | void Execute(); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/Builders/ServiceBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Builders 14 | { 15 | using Runtime; 16 | 17 | public interface ServiceBuilder 18 | { 19 | ServiceHandle Build(HostSettings settings); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Topshelf/Runtime/HostStartMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Runtime 14 | { 15 | public enum HostStartMode 16 | { 17 | Automatic = 0, 18 | Manual = 1, 19 | Disabled = 2, 20 | AutomaticDelayed = 3, 21 | } 22 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/HostConfigurators/EnvironmentBuilderFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.HostConfigurators 14 | { 15 | using Builders; 16 | 17 | public delegate EnvironmentBuilder EnvironmentBuilderFactory(HostConfigurator configurator); 18 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/HostConfigurators/ServiceBuilderFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.HostConfigurators 14 | { 15 | using Builders; 16 | using Runtime; 17 | 18 | public delegate ServiceBuilder ServiceBuilderFactory(HostSettings settings); 19 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/Configurators/Configurator.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Configurators 14 | { 15 | using System.Collections.Generic; 16 | 17 | public interface Configurator 18 | { 19 | IEnumerable Validate(); 20 | } 21 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/CommandLineParser/ISwitchElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.CommandLineParser 14 | { 15 | interface ISwitchElement : 16 | ICommandLineElement 17 | { 18 | string Key { get; } 19 | bool Value { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/CommandLineParser/IDefinitionElement.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.CommandLineParser 14 | { 15 | interface IDefinitionElement : 16 | ICommandLineElement 17 | { 18 | string Key { get; } 19 | string Value { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/HostConfigurators/HostBuilderFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.HostConfigurators 14 | { 15 | using Builders; 16 | using Runtime; 17 | 18 | public delegate HostBuilder HostBuilderFactory(HostEnvironment environment, HostSettings settings); 19 | } -------------------------------------------------------------------------------- /template.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @project@ 5 | @build.number@ 6 | @authors@ 7 | @authors@ 8 | @summary@ 9 | https://github.com/Topshelf/Topshelf/blob/master/LICENSE 10 | https://github.com/Topshelf/Topshelf 11 | http://topshelf-project.com/wp-content/themes/pandora/slide.1.png 12 | false 13 | @description@ 14 | @releaseNotes@ 15 | Topshelf 16 | @dependencies@ 17 | @references@ 18 | 19 | @files@ 20 | -------------------------------------------------------------------------------- /src/Topshelf/Logging/LogWriterOutputProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Logging 14 | { 15 | /// 16 | /// Delegate to provide the log output if the log level is enabled 17 | /// 18 | /// 19 | public delegate object LogWriterOutputProvider(); 20 | } -------------------------------------------------------------------------------- /src/SampleTopshelfService/SampleSansInterfaceService.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace SampleTopshelfService 14 | { 15 | public class SampleSansInterfaceService 16 | { 17 | public void Start() 18 | { 19 | } 20 | 21 | public void Stop() 22 | { 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/Configurators/ValidationResultDisposition.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Configurators 14 | { 15 | using System; 16 | 17 | [Serializable] 18 | public enum ValidationResultDisposition 19 | { 20 | Success, 21 | Warning, 22 | Failure, 23 | } 24 | } -------------------------------------------------------------------------------- /src/Topshelf/HostStartContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf 14 | { 15 | public interface HostStartContext : 16 | HostControl 17 | { 18 | /// 19 | /// If called, prevents the service from starting 20 | /// 21 | void CancelStart(); 22 | } 23 | } -------------------------------------------------------------------------------- /src/Topshelf/Runtime/Windows/WindowsUserAccessControl.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | 14 | namespace Topshelf.Runtime.Windows 15 | { 16 | using Logging; 17 | 18 | public static class WindowsUserAccessControl 19 | { 20 | static readonly LogWriter _log = HostLogger.Get(typeof (WindowsUserAccessControl)); 21 | } 22 | } -------------------------------------------------------------------------------- /src/Topshelf/Runtime/InstallHostSettings.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.Runtime 14 | { 15 | public interface InstallHostSettings : 16 | HostSettings 17 | { 18 | Credentials Credentials { get; set; } 19 | string[] Dependencies { get; } 20 | HostStartMode StartMode { get; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Topshelf/Configuration/HostConfigurators/CommandLineConfigurator.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2012 Chris Patterson, Dru Sellers, Travis Smith, et. al. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | // this file except in compliance with the License. You may obtain a copy of the 5 | // License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software distributed 10 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | // specific language governing permissions and limitations under the License. 13 | namespace Topshelf.HostConfigurators 14 | { 15 | using CommandLineParser; 16 | using Options; 17 | 18 | interface CommandLineConfigurator 19 | { 20 | void Configure(ICommandLineElementParser