If you are already comfortable working with system services, feel free
to skip to the section on using The Custom NT Service Name
Feature.
If you are running one of the following versions of Windows, you have
the option of running your BNBT or Trinity Edition
tracker as an NT (System) Service
instead of running it in a command interpreter window (command console).
Windows NT
Windows 2000
Windows XP
Windows Server 2003
Note: Your tracker should never be running as a system service AND in a command
console at the same time.
Pros and Cons
Here are some advantages (pros) to running your tracker as a system service:
System Services start automatically when your computer boots.
In most cases, logging into Windows isn't even necessary for your tracker to start.
System Services can be configured to auto-restart if the service crashes.
System Services run completely in the background, and in most cases use less resources.
The also means that the application will not take up room on your Windows Taskbar.
It is not necessary for you to manually shutdown your tracker when restarting
your computer.
Here are some disadvantages (cons) to running your tracker as a system service:
You will have no immediate visible proof that your tracker is running.
Error messages will only be sent to the tracker's log (if enabled) as
opposed to being displayed on your screen.
Note: It is highly recommended that you begin by running your tracker
in command console mode, until you have sufficiently configured all settings
and aspects of your tracker. In command console mode, it will be much easier
to shutdown and restart the tracker, which is required each time you modify
the configuration settings.
Running the tracker in a command console will also
write the default values for any required and missing configuration keys to
your tracker's configuration file, so that errors are not encountered when
running your tracker as a system service.
When you have finished setting up your tracker, we can then install and begin
running it as a system service. Installing a system service is very different
from installing an application. It is simply a process, by which you "add" a
program to your computer's System Services Console, so that Windows recognizes
it as a system service.
First, let us open the Microsoft Management Console (MMC) for System Services.
This can be accomplished in many ways, however the following is the simplest:
Click the Start button
Click Run...
Type services.msc and press ↵ Enter
Keyboard Shortcut: Pressing the Windows Key + R will open the Run... dialog.
You will be presented with a window that doesn't look dissimilar from this:
You should only be concerned with the first, third and fourth columns.
You may have to resize the window or click the Standard tab at the bottom to see
the fourth column.
Name — displays the service name for the application Note: this value must be unique, in that no two services can have the same service name
Status — if the service is running, this will read Started; if
the service is not running, this value will be blank.
Startup Type
Automatic — will be started with Windows
Manual — will NOT be started with Windows, but remains installed
as a system service; must be started manually.
We will now install the tracker executable as a system service.
Open a Command Prompt... (Open a Run dialog, type cmd and
press ↵ Enter
Change to the tracker's directory. If you installed BNBT as part of BNBT EasyTracker
and you accepted the default install location, this will be C:\Program Files\BNBT EasyTracker.
The path must be surrounded by quotation marks because spaces exist in the name.
CD "C:\Program Files\BNBT EasyTracker\" ↵
Type the following command to install BNBT as a system service:
bnbt -i ↵
The service is now installed.
The installation can be verified by going to the System Services MMC.
If it is still open, you will need to press F5 to refresh the list of services.
If you no longer want to run your tracker as a system service, there are
two ways this can be accomplished.
You could uninstall the service with the following commands:
CD "C:\Program Files\BNBT EasyTracker\" ↵ bnbt -u ↵
Important Note: You must stop the service before uninstalling it.
If you wanted to run the tracker as a service again, it would require that
you reinstall the service.
You could switch the Startup Type to Manual. This would leave
the service installed, but it won't automatically start the tracker in service
mode when the computer is booted.
To switch the Startup Type, right-click on the service in the MMC and click
Properties. Change Startup type to Manual and click OK.
Using the Custom NT Service Name Feature — a feature of The Trinity Edition of BNBT
The following feature is intended for individuals who are either already running
(or plan on running) 2 BNBT trackers (both as system services) from the
same PC. If you do not plan on running more than 1 tracker, it is recommended
that you do not modify the trinity_nt_service_name value in your
configuration file, as this can cause future errors to occur.
As discussed earlier in this tutorial, no two system services can have the same
name. By default, BNBT uses the following service name when installing itself:
BNBT Service. If you attempted to install a second instance of BNBT as a
system service, you would receive an error, because the service names are identical.
This is the reason that I originally created the Secondary Tracker Executable.
It had a different service name hard-coded into the program.
Enter the trinity_nt_service_name configuration key.
You can then go about installing each executable as a system service,
using the instructions found above.
Special Note: If this value is not specified in your configuration,
new versions of The Trinity Edition of BNBT will automatically add this key
and its default value (BNBT Service) to your configuration when you start
the executable for the first time.
Because of this new configuration key, it is actually possible to run more
than 2 trackers as system services, just as long as each of them have unique
service names.
Special Thanks to DWKnight and Varlock for helping me add
this feature to The Trinity Edition of BNBT.