Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How do I start/stop a service?


4 replies to this topic

YaI

YaI
  • Full Members
  • 13 posts

Posted 21 February 2007 - 11:51

In a basic MSI project, how do I start a service during install phase and how do i stop the service when the user uninstalls the appl??

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 21 February 2007 - 14:14

Check out the ServiceInstall and ServiceControl tables. ServiceControl is used to control already installed services (start, stop, delete), ServiceInstall is used to install services.
Regards
-Stein Åsmul

YaI

YaI
  • Full Members
  • 13 posts

Posted 22 February 2007 - 06:07

I've created a service in Control NT Services. I've set the value of UninstallStop and UninstallDelete to Yes. After uninstall, in the computer mangement window, I find the startup type of the service is disabled. The service is neither stopped nor removed from the list of services. The status of the service is still "Started". How do I remove the service??

Edited by YaI, 22 February 2007 - 06:11.


Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 22 February 2007 - 08:54

I have seen this happen and when it does you need to do a reboot to check what the status of the service is afterwards. Did you enable the "Wait for operation to complete" feature? You must obviusly wait for a service to be stopped completely before it can be successfully deleted.
Regards
-Stein Åsmul

haroldxious

haroldxious
  • Full Members
  • 70 posts

Posted 23 February 2007 - 03:16

in the installation sequences in Execute there is a Stop Services and Start Services standard actions you can use it and put some conditions. Or you can just make a custom action to start and stop services or you could simply add this to your code.

For example i will stop and start the spooler

ServiceStopService("Spooler");
Delay(5);

ServiceStartService("Spooler","")
Delay(5);