Windows Service Dependencies
-
Is there a way to either set a Windows Service (I'm not talking Web Services here) dependencies through code or through the installui utility? Once my VB.NET service is setup using the command line utility installui.exe, since I have the "Installer" class included in my project with all the options like Type (Automatic, Manual, Disabled), everything behaves like I want... except I see no easy way to set Service dependencies. The "hacked" way of doing it appears to be going to: HKLM\System\CurrentControlSet\Services\YourServiceName\ and adding a key called DependOnService of type REG_MULTI_SZ and then include the service name(s) you are dependent on. This does appear to work well... except there's got to be a better way than having to manually enter this stuff into the registry. Anyone?
-
Is there a way to either set a Windows Service (I'm not talking Web Services here) dependencies through code or through the installui utility? Once my VB.NET service is setup using the command line utility installui.exe, since I have the "Installer" class included in my project with all the options like Type (Automatic, Manual, Disabled), everything behaves like I want... except I see no easy way to set Service dependencies. The "hacked" way of doing it appears to be going to: HKLM\System\CurrentControlSet\Services\YourServiceName\ and adding a key called DependOnService of type REG_MULTI_SZ and then include the service name(s) you are dependent on. This does appear to work well... except there's got to be a better way than having to manually enter this stuff into the registry. Anyone?
You need a service installer in your project. Go to the Design view of your service and right-click in the designer and select 'add installer'. This will add a file called ProjectInstaller.vb which has a ServiceProcessInstaller and ServiceInstaller class. The property window of the ServiceInstaller class will let you add other service dependencies. Search the MSDN for an article entitled: Walkthrough: Creating a Windows Service Application in the Component Designer It gives all of the details.
-
You need a service installer in your project. Go to the Design view of your service and right-click in the designer and select 'add installer'. This will add a file called ProjectInstaller.vb which has a ServiceProcessInstaller and ServiceInstaller class. The property window of the ServiceInstaller class will let you add other service dependencies. Search the MSDN for an article entitled: Walkthrough: Creating a Windows Service Application in the Component Designer It gives all of the details.
Thanks for your reply... been meaning to say that. I had the installer and just missed it somehow. DUH Anyway, your reply made me look again and there it is. Thanks alot.