How-To install the smus as a NT Service
feedback : Sébastien

This method works well on Windows NT 3.51, 4 and 2000.

All services under NT are controlled by the Service Control Manager (SCM). Microsoft developed a small utility which is distributed with the Windows NT Resource Kit, and also available at the bottom of this page. The utility is called SRVANY.EXE and acts as a host (or service "wrapper") for your application. In other words, it becomes the service application which does all of the work and communicates with the SCM for you. When it starts, it looks at the registry to find out where your application is located. If it finds it, it starts your application.

       The configuration of your application as a NT service is straightforward.

       There are two programs Microsoft developed which pulls this trick off. The first, as I just mentioned, is SRVANY.EXE. SRVANY is a program which resides in your WINNT\SYSTEM32 folder, or the folder where your application resides. While in the end you may want to think of your application as a NT service, it's really this little gem that is the true service. When your service starts, it actually starts SRVANY, which starts your application.
       The second program Microsoft developed is called INSTSRV.EXE. This program installs SRVANY as a NT service. It is a command-line driven program, and once used is no longer needed unless you wish to add another service which uses SRVANY, or you wish to un-install a previously added service.

       While the documentation provided with SRVANY does a good job detailing the steps involved in its use, here's a visual step-by-step guide to installing SRVANY with the Smus :

Assumptions:


Step 1: Install SRVANY.EXE as a service using INSTSRV.EXE

Install app using INSTSRV


Step 2: Verify that your service got added by bringing up your services applet (control panel)


windows NT4 view

Verify service was added

windows2OOO view

 

Step 3 (windows 2000 only):

The default settings for SRVANY on Windows 2000 are not the same as those used on NT4, so an additional checkpoint may be required:

  1. Go to the HKLM\SYSTEM\CurrentControlSet\Services\Smus3 registry entry
  2. Check the value of the "ImagePath" string entry
  3. This value should be the full path to SRVANY including the extension. Correct it if it's not. If you put SRVANY in the smus folder, as described above, this full path should be "c:\Program Files\Macromedia\Shockwave Multiuser Server 3.0\srvany.exe".

 

At this point, your service has been created. However, if you were to try to start it now, it would fail. You next have to tell SRVANY where the application resides, so it can start it when the SCM starts SRVANY. Follow these steps to complete the installation of your new service:


Step 4: Add a "Parameters" key:

  1. Start your registry editor
  2. Find your service under HKLM\SYSTEM\CurrentControlSet\Services\Smus3
  3. Create a "Parameters" key


Step 5: Add an "Application" value:

  1. Open the "Parameters" key
  2. Create an "Application" string value (REG_SZ) within the "Parameters" key
  3. Edit "Application" and specify the full path of the app executable (including the extension) (should be "c:\Program Files\Macromedia\Shockwave Multiuser Server 3.0\MultiuserServer.exe")

 

Congratulations! You have just successfully turned the smus application into a Windows NT service. There are some other bits of information you should know about SRVANY and your new NT service application:


Download SRVANY

       To download SRVANY.EXE, INSTSRV.EXE, and supporting documentation, click the following download link.

    SRVANY.ZIP (24k)

Bibliography

       Microsoft knowledge base relative documents : click here