[ANN] win32-service 0.1.0

D

Daniel Berger

Hi all,

I am very pleased to announce the first release of
win32-service. This is an interface for reporting,
and creating, Win32 services on Windows NT, 2000 and
XP Pro.

Synopsis
========
require "win32/service"
include Win32

s = Service.new(
:service_name => "foo",
:exe_name => "C:\\some_dir\\foo.exe",
:display_name => "My Foo Service"
)

s.create_service

Service.start("foo")
Service.pause("foo")
Service.resume("foo")
Service.stop("foo")

Service.delete("foo")

Service.getdisplayname("Schedule") # "Task Scheduler"
Service.getservicename("ClipBook") # "ClipSrv"

# Enumerate over all services, inspecting each struct

Service.services{ |s|
p s
puts
}

This is the first package I've released as part of the
win32utils project, located on RubyForge at
http://rubyforge.org/projects/win32utils/.

Feedback welcome. Enjoy!

Regards,

Dan

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
 
P

Park Heesob

Hi,
----- Original Message -----
From: "Daniel Berger" <[email protected]>
To: "ruby-talk ML" <[email protected]>
Sent: Saturday, October 11, 2003 9:09 AM
Subject: [ANN] win32-service 0.1.0

Hi all,

I am very pleased to announce the first release of
win32-service. This is an interface for reporting,
and creating, Win32 services on Windows NT, 2000 and
XP Pro.
...

This is the first package I've released as part of the
win32utils project, located on RubyForge at
http://rubyforge.org/projects/win32utils/.

Feedback welcome. Enjoy!

It is a useful package!

I think it is more useful if it is able to set or update start type of a
service.
And the exception handling like already started or aleady stopped is
required.

Thank you for your effort.

Regards,

Park Heesob
 
D

Daniel Berger

Park Heesob said:
Hi,
----- Original Message -----
From: "Daniel Berger" <[email protected]>
To: "ruby-talk ML" <[email protected]>
Sent: Saturday, October 11, 2003 9:09 AM
Subject: [ANN] win32-service 0.1.0

Hi all,

I am very pleased to announce the first release of
win32-service. This is an interface for reporting,
and creating, Win32 services on Windows NT, 2000 and
XP Pro.
..

This is the first package I've released as part of the
win32utils project, located on RubyForge at
http://rubyforge.org/projects/win32utils/.

Feedback welcome. Enjoy!

It is a useful package!

I think it is more useful if it is able to set or update start type of a
service.
And the exception handling like already started or aleady stopped is
required.

Thank you for your effort.

Regards,

Park Heesob

Thanks for the feedback Park. I plan on adding start type, error
control, etc, options in the next release, so you'll get that.

As to the exception handling, I wondered about that. For example,
stopping an already stopped service apparently isn't an error in the
Win32 API. I thought that was peculiar, but I figured that if it
wasn't an error for Win32 it might be confusing if I forced an
Exception.

That's part of the reason I was going to add a "status()" class
method. Not only would folks be able to do a simple status check, I
would be able to use the method internally to possibly raise an
exception.

I guess it boils down to whether folks prefer to code something like
this:

if Service.status("ClipSrv") != "Stopped"
Service.stop("ClipSrv")
end

or this:

begin
Service.stop("ClipSrv")
rescue Win32ServiceException
puts "Service already stopped - ignoring stop request"
end

As things stand now, you can just do...

Service.stop("ClipSrv")

....and not worry about it.

I'll have to think about it between now and the next release.

Oh, and if you're interested in becoming a developer on the Win32Utils
project Park, I'd be happy to add you. :)

Regards,

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top