# Installation of Win32-service module

**URL:** <https://www.ruby-forum.com/t/installation-of-win32-service-module/62669>\
**Category:** Ruby\
**Created:** [June 7, 2006, 5:37am UTC](https://www.ruby-forum.com/t/installation-of-win32-service-module/62669 "2006-06-07T05:37:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jatinder\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Post date:** [June 7, 2006, 5:37am UTC](https://www.ruby-forum.com/t/installation-of-win32-service-module/62669/1 "2006-06-07T05:37:28Z")

</div>

Hi,

I intend to use Win32-service module to perform some operations with  
Windows  
services.

I downloaded win32-service-0.5.0 from Rubyforge and referring README,  
when I  
try to install this module by issuing “ruby extconf.rb” which results in  
following messages on console,

checking for EnumServicesStatusEx()… no  
checking for QueryServiceStatusEx()… no  
creating Makefile  
mkmf.log file gets generated with following contents,  
have\_func: checking for EnumServicesStatusEx()… --------------------  
no

“cl -nologo -Feconftest -I. -ID:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi  
-O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib  
advapi32.lib wsock32.lib -link -libpath:“D:/ruby/lib” -stack:0x2000000”  
checked program was:  
/\* begin \*/

/_top_/  
int main() { return 0; }  
int t() { EnumServicesStatusEx(); return 0; }  
/\* end \*/

“cl -nologo -Feconftest -I. -ID:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi  
-O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib  
advapi32.lib wsock32.lib -link -libpath:“D:/ruby/lib” -stack:0x2000000”  
checked program was:  
/\* begin \*/  
#include \<windows.h\>  
#include \<winsock.h\>

/_top_/  
int main() { return 0; }  
int t() { void ((_volatile p)()); p = (void  
((_)()))EnumServicesStatusEx;  
return 0; }  
/\* end \*/

* * *

have\_func: checking for QueryServiceStatusEx()… --------------------  
no

“cl -nologo -Feconftest -I. -ID:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi  
-O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib  
advapi32.lib wsock32.lib -link -libpath:“D:/ruby/lib” -stack:0x2000000”  
checked program was:  
/\* begin \*/

/_top_/  
int main() { return 0; }  
int t() { QueryServiceStatusEx(); return 0; }  
/\* end \*/

“cl -nologo -Feconftest -I. -ID:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi  
-O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib  
advapi32.lib wsock32.lib -link -libpath:“D:/ruby/lib” -stack:0x2000000”  
checked program was:  
/\* begin \*/  
#include \<windows.h\>  
#include \<winsock.h\>

/_top_/  
int main() { return 0; }  
int t() { void ((_volatile p)()); p = (void  
((_)()))QueryServiceStatusEx;  
return 0; }  
/\* end \*/

* * *

I verified by running daemon\_test.rb program that Win32-service was not  
installed.  
I have ruby 1.8.4(2005-12-24) installed on my machine.

Please help me out with the above issue.

Thanks in Advance,  
Jatinder

---

<div class="post-metadata">

**Author:** ![Jatinder\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Post date:** [June 7, 2006, 6:45am UTC](https://www.ruby-forum.com/t/installation-of-win32-service-module/62669/2 "2006-06-07T06:45:16Z")

</div>

Hi,

> Windows  
> services.
> 
> I downloaded win32-service-0.5.0 from Rubyforge and referring README, when  
> I  
> try to install this module by issuing “ruby extconf.rb” which results in  
> following messages on console,
> 
> checking for EnumServicesStatusEx()… no  
> checking for QueryServiceStatusEx()… no  
> creating Makefile

Above is normal message for Visual C++ 6.0.  
EnumServicesStatusEx and QueryServiceStatusEx added for Visual C++ 7.0  
or  
higher.

> I verified by running daemon\_test.rb program that Win32-service was not  
> installed.

After “ruby extconf.rb”  
You must run “nmake install” to complete installation.  
Then verify by running deamon\_test.rb

Regards,

Park H.

---

<div class="post-metadata">

**Author:** ![Jatinder\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Post date:** [June 7, 2006, 2:30pm UTC](https://www.ruby-forum.com/t/installation-of-win32-service-module/62669/3 "2006-06-07T14:30:03Z")

</div>

Hi Park,

I get following error message when I run “nmake install”,

Microsoft ® Program Maintenance Utility Version 1.50  
Copyright © Microsoft Corp 1988-94. All rights reserved.

```
    D:\ruby\bin\ruby -e "puts 'EXPORTS', 'Init_service'" >

```

service-i386-msw  
in32.def  
cl -nologo -MD -Zi -O2b2xg- -G6 -I.  
-ID:/ruby/lib/ruby/1.8/i386-mswin32  
-ID:/ruby/lib/ruby/1.8/i386-mswin32 -I. -c -Tcservice.c  
‘cl’ is not recognized as an internal or external command,  
operable program or batch file.  
NMAKE : fatal error U1077: ‘C:\WINDOWS\system32\cmd.exe’ : return code  
‘0x1’  
Stop.  
after running nmake i confirmed that win32-service has not been  
installed.

your help is appreciated.

Regards,  
Jatinder

---

<div class="post-metadata">

**Author:** ![Jatinder\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Post date:** [June 7, 2006, 2:36pm UTC](https://www.ruby-forum.com/t/installation-of-win32-service-module/62669/4 "2006-06-07T14:36:50Z")

</div>

I understand that “Cl” is the MSVC++ command line compiler, which looks  
like  
is not installed on my pc. is this a pre-requisite for using  
win32-service  
module?

I downloaded InstantRails which provides ruby,rails, apache and mysql; I  
found that the ruby provided by InstantRails comes with win32-service  
module, I tried using it by running daemon\_test.rb and bingo, it ran  
fine.

Now I dont want to depend on InstantRails, instead I would like to  
install  
win32-service module in a version of ruby which does not have  
win32-service  
module; for that do I need to have MS VC++, nmake utility on my machine?

Thanks and Regards  
Jatinder

---

<div class="post-metadata">

**Author:** ![Jatinder\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Post date:** [June 7, 2006, 5:52pm UTC](https://www.ruby-forum.com/t/installation-of-win32-service-module/62669/5 "2006-06-07T17:52:35Z")

</div>

Thanks Park!  
I am able to use win32-service module after copying service.so file to  
mentioned location.

-Jatinder

---

<div class="post-metadata">

**Author:** ![Jatinder\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Post date:** [June 7, 2006, 3:31pm UTC](https://www.ruby-forum.com/t/installation-of-win32-service-module/62669/6 "2006-06-07T15:31:34Z")

</div>

Hi,

> I downloaded InstantRails which provides ruby,rails, apache and mysql; I  
> found that the ruby provided by InstantRails comes with win32-service  
> module, I tried using it by running daemon\_test.rb and bingo, it ran fine.
> 
> Now I dont want to depend on InstantRails, instead I would like to install  
> win32-service module in a version of ruby which does not have win32-service  
> module; for that do I need to have MS VC++, nmake utility on my machine?

You can download compiled binary file “service.so” at  
[http://home.nownuri.net/~phasis/service.so](http://home.nownuri.net/~phasis/service.so)

Copy “service.so” to “\ruby\lib\ruby\site\_ruby\1.8\i386-msvcrt\win32”  
folder.

Regards,

Park H.
