PDA

View Full Version : windows services



cygnussphere
12-04-2003, 01:07 PM
With out using a third party app like FireDeamon. How do you install a .exe as a windows service?

:tempted:

:evil:

:cheers:

magnav0x
12-04-2003, 01:36 PM
You must download copies of instrsrv.exe and srvany.exe from the Windows NT
Resource Kit (will work with 2000 and XP), which I have attached to this post. You must also be logged in as Administrator of course.

Copy instrsrv.exe to your Windows\System32 directory.
Copy srvany.exe to the application's directory.

For example, lets says I have EON installed in c:\eon. I would copy srvany.exe to c:\eon and then run the following (Note 'EON' is what the service name would appear as):

instsrv.exe EON c:\eon\srvany.exe

Type Regedit to open a copy of the Registry Editor
Open and expand the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Highlight EON, then right-click and select New, Key
Type: Parameters
Highlight Parameters, right-click and add the following New String Values Names:
Application
AppDirectory
Double-click the Application value name you just created and enter the following Value Data: "c:\eon\client.exe"
Double-click the AppDirectory value name you just created and enter the following Value Data: "c:\eon"
Exit the Registry Editor.

Open the Services Control Panel in Administrative Tools.
Go to the EON service and double-click on it.
Set the Startup type to Automatic and click Apply. This will cause the service to automatically start at the next boot.
Select the Recovery tab and select the appropriate service failure options.

And now you are all set :cool:

cygnussphere
12-06-2003, 11:18 AM
You Rule Magnav0x:thumbs:

:notworthy :notworthy :notworthy

:tempted:

:evil:

:cheers:

Chinasaur
12-06-2003, 01:42 PM
And they say doing things in Linux is convoluted!!! :jester:


:cheers:

magnav0x
12-06-2003, 02:50 PM
And they say doing things in Linux is convoluted!!!

No kidding......you can easily set up a bash script to nohup a program at startup in about 30 seconds :rotfl:

cygnussphere
12-06-2003, 08:04 PM
No doubt things are easyer in Nix if your smart enough and have the time to learn it..

As for me I have to rely on the brains and generousity of my friends here to help me out.

If I want to run more than one instance on the same machine what am I going to have to do differant?


Thanks again Magnav0x:thumbs:
:notworthy :notworthy :notworthy

:tempted:

:evil:

:cheers:

magnav0x
12-06-2003, 08:06 PM
I presume you mean like have multiple instances of CB. Just give each service a different name (eg. Chessbrain Client 1, Chessbrain Client 2, etc)

cygnussphere
12-07-2003, 01:40 AM
Originally posted by magnav0x
I presume you mean like have multiple instances of CB. Just give each service a different name (eg. Chessbrain Client 1, Chessbrain Client 2, etc)

Ya, I want to set up CB node swarms.

instsrv.exe EON c:\eon\srvany.exe

Buy changing the "EON" ? Dosn't it have to have the same name as the .exe?

:tempted:

:evil:

:cheers:

magnav0x
12-09-2003, 11:42 AM
I'll pm ya ;)

magnav0x
12-09-2003, 11:54 AM
Empty your PM's buddy :cool:

cygnussphere
12-09-2003, 02:25 PM
err.. Dang I had no Idea I had been that busy pming... I'm all flushed out now:thumbs:

:tempted:

:evil:

:cheers:

the-mk
12-16-2003, 11:20 AM
Originally posted by magnav0x
You must download copies of instrsrv.exe and srvany.exe from the Windows NT
Resource Kit (will work with 2000 and XP), which I have attached to this post. You must also be logged in as Administrator of course.
. . .

Works great! Thanks magnav0x!

But is there a way of uninstalling that services (instead of disabling it in the Service Control Panel)?

magnav0x
04-28-2004, 04:35 PM
Oops missed this a long time ago. I'll go ahead and respond, because someone else my wonder the same thing in the future. Easiest way to delete it would go back to the registry where the Key is located for your service name and delete it from the registry.

PCZ
04-28-2004, 06:10 PM
I use instsrv and srvany a lot.
Microsft should include them in a default install.

I copy both instsrv and srvany to the windows directory {winnt on 2k }
There is no need to put srvany.exe in your client directories.

Once you learn how to use them you can run just about anything as a service.
Basically if you can run something from the command line then you can use srvany to
run it as a service.

The hardest part is editing the registry to add the Parameters but when you have done it a few times it becomes second nature.

If you have a lot of boxes to configure you can export the reg keys to a file to save a lot of typing.


To remove a service type the following:

instsrv 'name of service' remove

MerePeer
04-28-2004, 06:19 PM
I know this thread started out asking about "without Firedaemon", but I actually downloaded this earlier today because the TSC faq had mentioned it and I was having trouble getting instsrv/srvany to work properly for TSC when I logged out of windows (i.e. service seemed to stop running).

Firedeaemon has a free "lite" version which seems to be working for me in tsc and I must say was much easier than editing the .reg file I needed for the windows service. Thought I'd bring it up since it is free and says it does not have a time bomb in it. Lite version 1.6 here:
http://www.firedaemon.com/#downloads

Paratima
04-28-2004, 09:47 PM
PCZ: Agree completely. It's like the Microsofties think that the common folk mustn't be trusted with commands that do so much and work so well. Fortunately, there's the Resource Kits.

PCZ
04-28-2004, 10:41 PM
MerePeer

Services are not supposed to stop when you log out.

By default srvany runs as localsystem this won't stop when you log out.

The only reason I can think of that would stop a service running when you log out is if you have set the log on properties of the service to run under your own log in.

I run D2OL as a service using srvany and I don't have any issues with it.
TSC client is the same as D2OL so you shouldn't have any bother.

make sure you run with the controller:cli or controller:file switch.