CkService Perl Programming
Reference Documentation

CkService

Provides the ability to programmatically install and uninstall Windows Services. Start and stop services. Modify start-properties (auto-start, demand-start, disabled). Query to find out if a service is running or already-installed, etc.

Object Creation

$obj = new chilkat::CkService();

Properties

# Returns a boolean value
get_AutoStart( )

# newVal is a boolean (input)
put_AutoStart( newVal )

1 if the service should be auto-started when the computer starts, or 0 if the service should demand-started (not started at system startup time).

# str is a CkString object (output)
get_DisplayName( str )

# newVal is a string (input)
put_DisplayName( newVal )

The display name of the service.

# str is a CkString object (output)
get_ExeFilename( str )

# newVal is a string (input)
put_ExeFilename( newVal )

The absolute path + filename of the service's EXE.

# str is a CkString object (output)
LastErrorHtml( str )

Error information in HTML format for the last method called.

# str is a CkString object (output)
LastErrorText( str )

Error information in plain-text format for the last method called.

# str is a CkString object (output)
LastErrorXml( str )

Error information in XML format for the last method called.

# str is a CkString object (output)
get_ServiceName( str )

# newVal is a string (input)
put_ServiceName( newVal )

The name of the service (no SPACE chars allowed, should be alpha-numeric).

# Returns a boolean value
get_Utf8( )

# b is a boolean (input)
put_Utf8( b )

To be documented soon...

Methods

# Returns a boolean value
Disable( )

Disables a Windows service.

Returns 1 for success, 0 for failure.

# Returns a boolean value
Install( )

Installs a Windows service.

Returns 1 for success, 0 for failure.

# Returns an integer value
IsAutoStart( )

Returns 1 if the service is configured for auto-start, 0 if not, and -1 if it was not possible to check.

# Returns an integer value
IsDemandStart( )

Returns 1 if the service is configured for demand-start, 0 if not, and -1 if it was not possible to check.

# Returns an integer value
IsDisabled( )

Returns 1 if the service is disabled, 0 if not, and -1 if it was not possible to check.

# Returns an integer value
IsInstalled( )

Returns 1 if the service is already installed, 0 if not, and -1 if it was not possible to check.

# Returns an integer value
IsRunning( )

Returns 1 if the service is already installed and running, 0 if not, and -1 if it was not possible to check.

# filename is a string (input)
# Returns a boolean value
SaveLastError( filename )

Saves the last error information to an XML formatted file.

# Returns a boolean value
SetAutoStart( )

Configures an already-installed service for auto-start.

Returns 1 for success, 0 for failure.

# Returns a boolean value
SetDemandStart( )

Configures an already-installed service for demand-start.

Returns 1 for success, 0 for failure.

# Returns a boolean value
Start( )

Starts a service.

Returns 1 for success, 0 for failure.

# Returns a boolean value
Stop( )

Stops a service.

Returns 1 for success, 0 for failure.

# Returns a boolean value
Uninstall( )

Uninstalls a service.

Returns 1 for success, 0 for failure.

# Returns a string
displayName( )

The display name of the service.

# Returns a string
exeFilename( )

The absolute path + filename of the service's EXE.

# Returns a string
lastErrorHtml( )

Error information in HTML format for the last method called.

# Returns a string
lastErrorText( )

Error information in plain-text format for the last method called.

# Returns a string
lastErrorXml( )

Error information in XML format for the last method called.

# Returns a string
serviceName( )

The name of the service (no SPACE chars allowed, should be alpha-numeric).