PVFLauncher Tutorial
PVF
Launcher allows you to run any normal application as a Windows NT / 2000 / XP /
2003 service. This
is very useful especially for Java programmers. It's very easy to write a server
in Java, but if you want to make it run like a service you'll see it's very hard
(especially if you want to keep the platform independence). With PVFLauncher
you can transform your Java program into a Windows service in just
a few minutes.

|
|
It's obvious
that you must first download and install the PVFLauncher.
From the download section of this website, you can obtain
the latest release. After downloading, you must install
it. For this, extract the contents of the archive to
a folder on your harddisk and run the following command:
pvflauncher -install
After you have
executed the above command, the PVFLauncher service
is installed and ready to be used. You can check this
by going to "Control Panel/ Administrative Tools/
Services". Here you should see the PVFLauncher
service.
|

|
|
To register your
application with PVFLauncher, you must add a few entries
in the registry. Below you can see an
example .reg file for starting the PVFServer (a server written
in Java): [HKEY_LOCAL_MACHINE\SOFTWARE\PVF\PVF
Launcher\PVFServer] "run"="E:\\Program
Files\\pvf\\jre\\bin\\java.exe" "dir"="E:\\Program
Files\\pvf\\server\\" "arg4"="-c" "arg3"="Server" "arg1"="-cp" "arg2"="." Note:
In the example above, you must replace the paths with your own paths (for
example, you should replace "E:\\Program
Files\\pvf\\jre\\bin\\java.exe" with the path to your java
executable).
In case you haven't
figured out what those keys represent, here is an explanation:
Key
|
Description
|
run
|
This is the full name (path+filename+extension)
of the program to be started. In some cases
you can skip the path, but it's generally
a good idea to use it.
|
dir
|
The directory where the application will
be started. This may be the program directory
or any other directory. This is also called
the working directory.
|
arg1 ... argn
|
These are the arguments that will be
passed to the application. You can use as
many arguments as you like. The first argument
is called arg1. These keys are optional.
If your application don't need any arguments
you will not create these keys.
|
Warning:
Your program should not stop working after some time.
PVFLauncher is designed to run applications like servers
that must be running all the time. That's way it will
detect when an application terminates and will restart
it. If you need to run a program only for a certain
amount of time, you must implement a thread (or something)
that will keep your application running. If not, your
program will be restarted.
|

|
|
To launch a new
application, PVFLauncher must be restarted. The easiest
way to do this is by restarting your computer. You may
also restart the PVFLauncher service, but keep in mind
that the applications started by PVFLauncher are not
terminated when the service is stopped (so you will
end up with the same applications running two times).
|

|
|
You must always
think that you may not be the only one using PVFLauncher
on a certain computer (possibly your computer). There
may be other applications that rely on PVFLauncher to
be started. That's why you should not do anything that
could disturb those programs.
- DO NOT uninstall PVFLauncher when you remove
your application. Instead, remove only the registry
entries used to start your program.
- DO NOT rely on information acquired at installation
time about PVFLauncher. There may be another program
using PVFLauncher that was installed after your
application.
|
|