2 // System.ServiceProcess.ServiceInstaller.cs
5 // Geoff Norton (gnorton@customerdna.com)
7 // (C) 2005, Geoff Norton
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System.Collections;
33 using System.ComponentModel;
34 using System.Configuration.Install;
36 using System.Runtime.InteropServices;
39 namespace System.ServiceProcess
42 public class ServiceInstaller : ComponentInstaller
44 public ServiceInstaller ()
48 private string display_name;
49 private string service_name;
50 private string[] services_depended_on;
51 private ServiceStartMode start_type;
54 private string description;
58 [ServiceProcessDescription ("Indicates the service's description (a brief comment that explains the purpose of the service). ")]
59 public string Description {
71 [ServiceProcessDescription ("Indicates the friendly name that identifies the service to the user.")]
73 public string DisplayName {
84 [ServiceProcessDescription ("Indicates the name used by the system to identify this service.")]
86 [TypeConverter("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
87 public string ServiceName {
92 if (value == null || value.Length == 0 || value.Length > 256)
93 throw new ArgumentException ();
99 [ServiceProcessDescription ("Indicates the services that must be running in order for this service to run.")]
101 public string[] ServicesDependedOn {
103 return services_depended_on;
106 services_depended_on = value;
110 [DefaultValue (ServiceStartMode.Manual)]
112 [ServiceProcessDescription ("Indicates how and when this service is started.")]
114 public ServiceStartMode StartType {
123 public override void CopyFromComponent (IComponent component)
125 if (!component.GetType ().IsSubclassOf (typeof (ServiceBase)))
126 throw new ArgumentException ();
129 public override void Install (IDictionary stateSaver)
131 throw new NotImplementedException ();
134 public override bool IsEquivalentInstaller (ComponentInstaller otherInstaller)
136 throw new NotImplementedException ();
139 public override void Rollback (IDictionary savedState)
141 throw new NotImplementedException ();
144 public override void Uninstall (IDictionary savedState)
146 throw new NotImplementedException ();