Invoker Usage and Installation

For both service installations and service removals from Windows, the following table defines usage terms:

service_name name used internally by SCM
service_label display name as it appears in the Services Control Panel, for multiple words use double-quotes
executable path to executable, use double-quotes for long file/folder name
startup_type service startup type - automatic, manual (default), disabled

How to install a service:

Step 1. Download Invoker and unzip the archive into a folder somewhere in your command path, such as the winnt folder.

Step 2. Fire up a command prompt and type in the following command to create a service. For this example we will create a service out of a java application:

invoker install MyJavaApp "My Java App" "java.exe" automatic

Use the following as syntax for installations:
invoker install service_name service_label executable startup_type

If no errors are encountered, there should be a service with the label specified in the registry and in the Services Control Panel. If not, check the FAQ for solutions to possible problems, such as invoker.exe not being located in your command path.

Step 3. (optional) Before you start the service if you need to specify command line arguments for the application (such as a classpath for java apps) or the working directory, you will need to edit those values in the registry (invoker automatically creates empty values for the service on creation). The steps described below are optional, but if your program requires them to function properly, they are necessary. (I strongly suggest backing up the registry before making any changes to it, edit your registry at your own risk!). Open your registry editor, regedt32.exe.

Step 4. (optional) Inside regedt32 for this example we will want to navigate to:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MyJavaApp\Parameters

Inside the Parameters key there are 3 string values: Application, AppParameters and AppDirectory. You will notice that the Application value has already been filled in from the creation of the service.

Another application parameter may be used here to force the logging of child process output to the Windows Event Log. Add EventLog (REG_DWORD) with a non-zero value to turn on event logging.

Step 5. (optional) Double-click on the AppParameters value and type in any arguments you need for your executable. This value is optional can be left blank. If there is a path with a long folders or filenames you will (and can) need to use double-quotes around the path. This is standard procedure for command line options. For example:

-classpath "c:\demos\app\server\app.zip;c:\lib\jdk102\java\lib\classes.zip" app.bw.server.CServer

Step 6. (optional) Do the same for AppDirectory and type in the working directory for the executable. This value is optional and can be left blank. Do NOT use double-quotes if you have long folders. For example:

c:\demos\app\server

Step 7. (optional) Add an "EventLog" registry entry at the same location as the AppParameters registry entry. This value is optional, and is of type REG_DWORD. A non-zero value indicates a true value for sending child process output to the Windows Event Log. A zero value or no EventLog registry entry turns off Event Logging.

Step 8. Open up your Services Control Panel and start up the service (you can also switch the Startup Type if you wish). If you receive any errors such as the service failing to start or stop, check your Event Viewer for any local problems or please see our FAQ for solutions to possible problems. Also note that service installation ties the service to the location of invoker.exe when the service is initially installed. Do not move the invoker.exe if you have services bound to its location.

 

How to remove a service:

Step 1. With the knowledge that invoker.exe is in your command path, first stop the service in the Services Control Panel if it is currently running then at a command prompt type in the invoker command with the remove parameter as done in this example:

invoker remove MyJavaApp

For removals use this syntax:

invoker remove service_name

That's all you have to do to remove a service created by invoker. You can also get list of available options at the command prompt by typing:

invoker /?