Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB as a service - failed to install

Status
Not open for further replies.

shootsie

Programmer
Apr 12, 2001
43
US
I am writing a service in Visual basic using the NTSVC.ocx control. So far everything's been going really smoothly -- I compile the program, then run it with the -install parameter and it installs -- until my last compile. Now everytime I try to install a compiled version it fails. I have no more information. Any suggestions?
 
That will happen if it is already installed. Are you running it with the -uninstall OK before trying to re-install?
 
No, however I am manually uninstalling it first and the uninstall will not work. The service is also not appearing in the service manager.
 
How did you manually uninstall it? Did you delete the registry keys it creates?

Much easier to get the -uninstall working...
 
I meant manually by manually running the commandline with -uninstall after it. Since this problem came about, however, neither the -uninstall or -install or working.

Any other ideas?

Thanks!!!
 
Another note: I did change the name of the service before the problem happened. Since then, I have tried to change the name back to the old name, do another uninstall, and the install it back. I DID get a successfull uninstall -- but I am still unable to get a successfull install both with the old and with the new name.

Does anyone know how to manually (registry settings, etc.) uninstall a service? Perhaps something didn't happen all of the way.

Thanks!
 
Try deleting any references to your service (if they exist) from the registry under local machine\system\current control set\services.

Hard to say really though, some weird stuff can happen if you run install or actually start the service (without -debug) from within the VB environment.

If you really get stuck you can send me the code at rdroske@frontrunnernetworks.com and I should be able to tell if it is a real bug in the service or a config thing like that.






 
One of the "gotchas" with the NT Service OCX is that you can't debug it. If you have any breakpoints in the service code it will fail to run.

If you're starting a timer in your Start event, put your breakpoints in the TimerClick event.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Actually, I could debug it without a problem. I finally just deleted the control, then re-added it with the same name. Some hints for future reference:

-ALWAYS uninstall with the same compilation that you installed with
-Don't change the name of the service

Perhaps some people could get that second point to work, but I had SEVERE problems when I tried to change the name. I guess the first point is a given, but it didn't occur to me how important it was until after it was a problem.
 
Yes, actually it is very easy to debug. there is a command line parameter -debug that allows tou to run it in the VB debug environment...
 
Right, I just put the "-debug" command line argument in the project files properties "make" tab.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top