yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: Creating a service
Well, as far as I know, every app can be run as a service. In fact a service isn't nothing else than a program that's run at startup and keeping running until you shut your pc. So you can do it with every program (or file) you want, and not necessarily written in VB (even an HTML file for instance).
Now, you need:
- to have a program that's capable to work in background until the user explicitly closes it (or otherwise, until the session ends);
- to launch it at startup
- to combine this two features into your project.
The second is the one you need: you have to put your app's final path into the registry Run or Runservices key of user's pc. But at the moment, you don't know what will be the user's final path (he could choose another installation path during install phase, or manually move the app directory). So you should manage the installation process:
- have an install program. It can be even the MSI installer created packet, or a custom install launcher
- define an installation default directory, that can be changed by user, and store this path in a string variable
- configure the MSI packet, or your install launcher, to write in the Run registry key the path.
That's all. When the installation is finished, and your user reboots his pc, it will run your app. It will keep running until the user will explicitly close it, or otherwise until the pc is shut down.
There are other methods to make an app to execute at startup, but this one is the most used by developpers.
HTH
____________________________
Real Programmer can count up to 1024 on his fingers
|