com.denova.runtime
Class WindowsServices

java.lang.Object
  extended by com.denova.runtime.WindowsServices
All Implemented Interfaces:
WindowsConstants

public class WindowsServices
extends java.lang.Object
implements WindowsConstants

Manage Windows services.

Author:
DeNova © 1997-2010 DeNova.com Last modified: 2012-04-04

Field Summary
 
Fields inherited from interface com.denova.runtime.WindowsConstants
AddRegistryEntry, AllUsers, ArchitectureAMD64, ArchitectureIA64, ArchitectureIntel, ArchitectureUnknown, ArchitectureX64, ArchitectureX86, ArchitectureX86_64, BinaryType, CurrentUser, DeleteAttribute, DeleteRegistryEntry, DesktopSpecFilename, DWordType, ExecExtension, InvokerFilename, MenuSpecFilename, RegistrySpecFilename, ReplaceRegistryEntry, StringType, WindowsCleanupCommand, WindowsCmdLogFilename, WindowsDelDesktop, WindowsDelProgramsMenu, WindowsDelStartupMenu, WindowsProgramsMenuCommand, WindowsRegistryEditorCommand
 
Constructor Summary
WindowsServices()
           
 
Method Summary
 boolean installService(java.lang.String executable)
          Install a service using .Net utility.
 boolean installService(java.lang.String serviceName, java.lang.String executable)
          Install a service.
 boolean installService(java.lang.String serviceName, java.lang.String serviceLabel, java.lang.String executable, boolean automatic)
          Install a service.
 boolean removeService(java.lang.String serviceName)
          Deprecated.  
 boolean removeService(java.lang.String serviceName, java.lang.String executable)
          Remove a service.
 boolean supportServices()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowsServices

public WindowsServices()
Method Detail

installService

public boolean installService(java.lang.String executable)
Install a service using .Net utility.

Parameters:
executable - is the pathname to the executable; use double quotes for filenames with spaces
Returns:
true if successful.

installService

public boolean installService(java.lang.String serviceName,
                              java.lang.String executable)
Install a service. Use .Net if available; otherwise, use invoker.

Parameters:
serviceName - is the name used by SCM and Service Control Panel.
executable - is the pathname to the executable; use double quotes for filenames with spaces
Returns:
true if successful.

installService

public boolean installService(java.lang.String serviceName,
                              java.lang.String serviceLabel,
                              java.lang.String executable,
                              boolean automatic)
Install a service. Use .Net if available; otherwise, use invoker.

Parameters:
serviceName - is the name used internally by SCM
serviceLabel - is the name that displays in the Service Control Panel
executable - is the pathname to the executable; use double quotes for filenames with spaces
automatic - is set true, if you want the service invoked automatically on startup
Returns:
true if successful.

removeService

public boolean removeService(java.lang.String serviceName)
Deprecated. 

Remove a service. Uses invoker.

Parameters:
serviceName - is the name used internally by SCM
Returns:
true if successful.

removeService

public boolean removeService(java.lang.String serviceName,
                             java.lang.String executable)
Remove a service. Use .Net if available; otherwise, use invoker.

Parameters:
serviceName - is the name used internally by SCM
executable - is the pathname to the executable; use double quotes for filenames with spaces
Returns:
true if successful.

supportServices

public boolean supportServices()
Returns:
true if able to install services on this system.