From: Daniel Berger Date: 2007-12-13T01:10:00+09:00 Subject: Re: 1053 Error about win32-service On Dec 11, 8:51 pm, Kai Geng wrote: > Hi > I have installed the gem of win32-service-0.6.0-x86-mswin32-60.gem.But > when I run my test code such as: > > require 'rubygems' > require 'win32/service' > include Win32 > > s = Service.new > s.create_service{ |srv| > srv.service_name = "foo" > srv.binary_path_name = "D:\\Ruby\\bin\\ruby "+File.expand_path($0) > srv.display_name = "Test_service"} > > s.close > > Service.start("foo") One thing you'll want to be aware of is that there was an interface change in 0.6.0. Here's an example that uses most of the available options: # Create a new service Service.create('some_service', nil, :service_type => Service::WIN32_OWN_PROCESS, :description => 'A custom service I wrote just for fun' :start_type => Service::AUTO_START, :error_control => Service::ERROR_NORMAL, :binary_path_name => 'C:\path\to\some_service.exe', :load_order_group => 'Network', :dependencies => ['W32Time','Schedule'] :service_start_name => 'SomeDomain\\User', :password => 'XXXXXXX', :display_name => 'This is some service', ) Regards, Dan